emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Rainer@krugs.de
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
	Christian Moe <mail@christianmoe.com>,
	Eric Schulte <schulte.eric@gmail.com>
Subject: Re: [BABEL] Define tables with names in org?
Date: Fri, 10 Jan 2014 13:31:41 +0100	[thread overview]
Message-ID: <m238kwyq4y.fsf@uio.no> (raw)
In-Reply-To: <52CFBB6B.5040406@krugs.de>


Rainer M Krug writes:

> On 01/09/14, 20:25 , Eric Schulte wrote:
>> See "Indexable variable values" under (info "(org)var"), it may
>> help.
>
> Thanks - but I don't see how this could help me in this case?
>
> To correct my example (to fast copy - paste):
>
> * INTERNAL VARIABLES                                 :noexport:
>
> ** With column names
> #+NAME: WITH_COLNAMES
> |   | name          |
> |---|---------------|
> | a | NPPyC         |
> | b | DBBVy         |
> | c | DBRFy         |
> | d | DBSSy         |
> | e | levelstress_2 |
> #+PROPERTY: var+ WITH_COLNAMES=WITH_COLNAMES
>
> ** Without column names
> #+NAME: WITHOUT_COLNAMES
> | name          |
> |---------------|
> | NPPyC         |
> | DBBVy         |
> | DBRFy         |
> | DBSSy         |
> | levelstress_2 |
> #+PROPERTY: var+ WITHOUT_COLNAMES=WITHOUT_COLNAMES
>
> * The code
> #+begin_src R
>   # here WITH_COLNAMES will have colnames and WITHOUT_COLNAMES not
> #+end_src
>
> * And some more code
> #+begin_src R
>   # here WITH_COLNAMES will have colnames and WITHOUT_COLNAMES not
> #+end_src
>
> So my concern is not about having rownames where I don't need them,
> but in having always to enter rownames in the definition (INTERNAL
> VARIABLES section), as I need them in the WITH_COLNAMES table.

I'm not sure I understand the example. You have two otherwise identical
tables, with and without rownames. And then you assign them to two
variables, WITHOUT_COLNAMES and WITH_COLNAMES. Do you mean
WITHOUT_ROWNAMES and WITH_ROWNAMES ?

If so, is your problem how to include or exclude the rownames when you
assign the table to the respective variables?

If so, I don't think it can be done with per-document global settings
using +PROPERTY lines.

Also, I think (?) that Eric's suggestion to index into the data wouldn't
work, because however you slice the data, the issue is not what ends up
as the leftmost column, but whether R understands the leftmost column as
rownames or not. But I may be misunderstanding something here.

You can use the :header-args: property of an outline heading to set
:rownames yes or :rownames no for all the *src* blocks under that
heading, if that is a meaningful way to structure your document. Going
by your examples, though, it probably isn't.

It might be simpler to solve the problem in R rather than Org by
either adding or removing rownames as needed.

Yours,
Christian

      reply	other threads:[~2014-01-10 12:30 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
2014-01-10  9:20       ` Rainer M Krug
2014-01-10 12:31         ` Christian Moe [this message]

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=m238kwyq4y.fsf@uio.no \
    --to=mail@christianmoe.com \
    --cc=Rainer@krugs.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@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).