From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: [BABEL] Define tables with names in org? Date: Fri, 10 Jan 2014 13:31:41 +0100 Message-ID: References: <52CE89A9.8060305@krugs.de> <52CEAA76.2090901@krugs.de> <87k3e9j6i3.fsf@gmail.com> <52CFBB6B.5040406@krugs.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1bER-0006Sf-Am for emacs-orgmode@gnu.org; Fri, 10 Jan 2014 07:30:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1bEH-0005g7-U8 for emacs-orgmode@gnu.org; Fri, 10 Jan 2014 07:30:35 -0500 Received: from mail-forward2.uio.no ([2001:700:100:10::71]:53463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1bEH-0005HS-JZ for emacs-orgmode@gnu.org; Fri, 10 Jan 2014 07:30:25 -0500 Received: from exim by mail-out2.uio.no with local-bsmtp (Exim 4.75) (envelope-from ) id 1W1bDf-00045G-Ip for emacs-orgmode@gnu.org; Fri, 10 Jan 2014 13:29:47 +0100 In-reply-to: <52CFBB6B.5040406@krugs.de> 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: Rainer@krugs.de Cc: emacs-orgmode , Christian Moe , Eric Schulte 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