From: Eric Schulte <schulte.eric@gmail.com>
To: Rainer@krugs.de
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
Christian Moe <mail@christianmoe.com>
Subject: Re: [BABEL] Define tables with names in org?
Date: Thu, 09 Jan 2014 12:25:01 -0700 [thread overview]
Message-ID: <87k3e9j6i3.fsf@gmail.com> (raw)
In-Reply-To: 52CEAA76.2090901@krugs.de
Rainer M Krug <Rainer@krugs.de> writes:
> On 01/09/14, 13:30 , Christian Moe wrote:
>>
>> Rainer M Krug writes:
>>
>>> I would like to define a table with named columns and rows, so
>>> that the table is passed to R including the column and row names
>>> - is this possible?
>>
>> Yes, just use the leftmost column for row names and include the
>> header argument :rownames yes.
>>
>> By default, the first row will be used for column names if followed
>> by a hline. Without a hline, use :colnames yes.
>>
>> E.g.:
>>
>> #+name: colrownamestbl | | Alpha | Beta | Gamma |
>> |--------+-------+------+-------| | First | A1 | B1 | C1
>> | | Second | A2 | B2 | C2 | | Third | A3 | B3 | C3
>> |
>>
>> #+begin_src R :var data=colrownamestbl :rownames yes :results
>> output colnames(data) rownames(data) #+end_src
>>
>> #+RESULTS: : [1] "Alpha" "Beta" "Gamma" : [1] "First" "Second"
>> "Third"
>
> Ah - I see. Nice. Thanks.
>
> One problem though:
>
> I define my variables in the beginning of the document, in a not
> exported heading so that they don't show in the report, and I want to
> have some variables with rownames and some without. Is this possible?
>
See "Indexable variable values" under (info "(org)var"), it may help.
>
> * INTERNAL VARIABLES :noexport:
>
> ** Without column names
> #+NAME: WITHCOLNAMES
> | name |
> |---------------|
> | NPPyC |
> | DBBVy |
> | DBRFy |
> | DBSSy |
> | levelstress_2 |
> #+PROPERTY: var+ WITHCOLNAMES=WITHCOLNAMES
>
> ** Without column names
> #+NAME: COLS_TO_EVAL
> | name |
> |---------------|
> | NPPyC |
> | DBBVy |
> | DBRFy |
> | DBSSy |
> | levelstress_2 |
> #+PROPERTY: var+ COLS_TO_EVAL=COLS_TO_EVAL
>
> And this should be valid everywhere where I use WITHCOLNAMES and
> WITHOUTCOLNAMES in R without having to specify :rownames true each time?
>
> Rainer
>
>
>>
>> Yours, Christian
>>
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel : +33 - (0)9 53 10 27 44
> Cell: +33 - (0)6 85 62 59 98
> Fax : +33 - (0)9 58 10 27 44
>
> Fax (D): +49 - (0)3 21 21 25 22 44
>
> email: Rainer@krugs.de
>
> Skype: RMkrug
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D
next prev parent reply other threads:[~2014-01-09 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 11:36 [BABEL] Define tables with names in org? Rainer M Krug
2014-01-09 12:30 ` Christian Moe
2014-01-09 13:56 ` Rainer M Krug
2014-01-09 19:25 ` Eric Schulte [this message]
2014-01-10 9:20 ` Rainer M Krug
2014-01-10 12:31 ` Christian Moe
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=87k3e9j6i3.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=Rainer@krugs.de \
--cc=emacs-orgmode@gnu.org \
--cc=mail@christianmoe.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).