emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Roland Donat <roland.donat@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to pass named table reference in source block variable
Date: Wed, 07 Aug 2013 05:29:25 -1000	[thread overview]
Message-ID: <m1y58dv7sa.fsf@poto.myhome.westell.com> (raw)
In-Reply-To: <loom.20130807T102035-552@post.gmane.org> (Roland Donat's message of "Wed, 7 Aug 2013 08:28:17 +0000 (UTC)")

Roland Donat <roland.donat@gmail.com> writes:

> Thorsten Jolitz <tjolitz <at> 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

  reply	other threads:[~2013-08-07 15:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06 21:31 How to pass named table reference in source block variable Roland Donat
2013-08-06 22:22 ` Thorsten Jolitz
2013-08-06 22:27   ` Nick Dokos
2013-08-07  8:28   ` Roland Donat
2013-08-07 15:29     ` Thomas S. Dye [this message]
2013-08-07 20:06       ` Roland Donat
2013-08-07 21:53         ` Thomas S. Dye
2013-08-08  7:55           ` Roland Donat
2013-08-08 15:10             ` Eric Schulte
2013-08-08 15:42               ` Roland Donat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1y58dv7sa.fsf@poto.myhome.westell.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=roland.donat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).