From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: How to pass named table reference in source block variable Date: Wed, 07 Aug 2013 05:29:25 -1000 Message-ID: References: <87mwou1mu6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V75gX-0002h7-HU for emacs-orgmode@gnu.org; Wed, 07 Aug 2013 11:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V75gR-00012j-C9 for emacs-orgmode@gnu.org; Wed, 07 Aug 2013 11:30:01 -0400 Received: from oproxy9-pub.mail.unifiedlayer.com ([69.89.24.6]:37437) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1V75gR-00012N-48 for emacs-orgmode@gnu.org; Wed, 07 Aug 2013 11:29:55 -0400 In-Reply-To: (Roland Donat's message of "Wed, 7 Aug 2013 08:28:17 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Roland Donat Cc: emacs-orgmode@gnu.org Roland Donat writes: > Thorsten Jolitz gmail.com> writes: > >> >> This does the job in Emacs Lisp: >> >> #+TBLNAME: T >> | | x | 1 | >> | ^ | | varx | >> >> #+begin_src emacs-lisp :var x=T[0,-1] >> x >> #+end_src >> >> #+results: >> : 1 >> > > Thanks for the answer but in fact, my objective is precisely to avoid using > the indices of the value I want to pass as input of the code block. > > My goal is to use the cell name reference "varx" which would make the code > block simpler to maintain. Indeed, if I add new data on the top of table T, > I wouldn't have to change the reference in the code block since the name > reference is fixed. > > Perhaps this can help: http://orgmode.org/worg/org-contrib/babel/examples/lob-table-operations.html Alternatively, you might pass the table to a code block of a language that understands tables, such as an R data frame, and use that language to retrieve values by name. hth, Tom -- Thomas S. Dye http://www.tsdye.com