From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Naming a table produced by a CALL Date: Mon, 27 Jan 2014 12:39:21 +0100 Message-ID: <874n4pejrq.fsf@med.uni-goettingen.de> References: <87zjml61t9.fsf@hornfels.zedat.fu-berlin.de> <8738kd1qh2.fsf@med.uni-goettingen.de> <87txct5vbs.fsf@hornfels.zedat.fu-berlin.de> <87y524z996.fsf@med.uni-goettingen.de> <877g9my2k6.fsf@gmail.com> <87eh3toit0.fsf@hornfels.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7kXV-0004rD-Fu for emacs-orgmode@gnu.org; Mon, 27 Jan 2014 06:39:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7kXQ-0001B8-Dp for emacs-orgmode@gnu.org; Mon, 27 Jan 2014 06:39:41 -0500 Received: from plane.gmane.org ([80.91.229.3]:40998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7kXQ-0001An-75 for emacs-orgmode@gnu.org; Mon, 27 Jan 2014 06:39:36 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W7kXO-0006kE-3q for emacs-orgmode@gnu.org; Mon, 27 Jan 2014 12:39:34 +0100 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jan 2014 12:39:34 +0100 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jan 2014 12:39:34 +0100 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: emacs-orgmode@gnu.org Hi Loris, "Loris Bennett" writes: > Eric Schulte writes: > >> Andreas Leha writes: >> >>> Hi Loris, >>> >>> "Loris Bennett" writes: >>> >>>> Andreas Leha writes: >>>> >>>>> "Loris Bennett" writes: >>>>> >>>>>> Hi, >>>>>> >>>>>> I have a CALL which produces a table, which just gets the keyword >>>>>> RESULT. I would like to plot the data in the table with R and so would >>>>>> like to refer to the data in the table. >>>>>> >>>>>> It seems I need to need to replace RESULT by NAME in >>>>>> org-babel-results-keyword, but how do I pass the actual name? >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Loris >>>>> >>>>> Make the CALL named: >>>>> >>>>> #+name: foo >>>>> #+call: foo() >>>>> >>>>> HTH, >>>>> Andreas > > This seems to break if I then try to reference the results of the call: > > #+NAME: test > #+BEGIN_SRC sh > echo a b c > echo 1 2 3 > echo 4 5 6 > #+END_SRC > > #+NAME: call-test > #+CALL: test() :results table :colnames yes > #+RESULT: call-test > | a | b | c | > |---+---+---| > | 1 | 2 | 3 | > | 4 | 5 | 6 | > > #+NAME: r-test > #+HEADER: :var data=call-test I'd expect this to be call-test() ^^ But it works for me with both call-test and call-test(). > #+HEADER: :colnames yes > #+BEGIN_SRC R > data > #+END_SRC > > #+RESULT: r-test > | x | > |-----| > | nil | > > Is it perhaps not clear whether "call-test" refers to the result or the > call? Or is my config broken? I'm using version > > 8.2.5g (8.2.5g-7-gb2dce8-elpaplus). > > Cheers, > > Loris > quick test on my setup with Org-mode version 8.2.4 (release_8.2.4-332-g7059d3): --8<---------------cut here---------------start------------->8--- #+NAME: test #+BEGIN_SRC sh echo a b c echo 1 2 3 echo 4 5 6 #+END_SRC #+results: test | a | b | c | | 1 | 2 | 3 | | 4 | 5 | 6 | #+NAME: call-test #+CALL: test() :results table :colnames yes #+results: call-test | a | b | c | |---+---+---| | 1 | 2 | 3 | | 4 | 5 | 6 | #+NAME: r-test #+HEADER: :var data=call-test #+HEADER: :colnames yes #+BEGIN_SRC R data #+END_SRC #+results: r-test | a | b | c | |---+---+---| | 1 | 2 | 3 | | 4 | 5 | 6 | --8<---------------cut here---------------end--------------->8--- Are you sure about your '#+RESULT' ? The default value for org-babel-results-keyword seems to be 'RESULTS' with an 'S'. (I have customized that to be lower case 'results'.) Regards, Andreas >>>> Thanks. In retrospect, that seems quite obvious. Where is this >>>> documented and should it be mentioned here: >>>> >>>> http://orgmode.org/manual/Evaluating-code-blocks.html >>>> >>> >>> This is a 'not-so-old' feature. >> >> Yes, I believe this was added in the last month or two. >> >>> And I do not know whether it is documented at all. I agree that >>> 'Evaluating code blocks' is where the documentation should go. >>> >> >> I'll happily apply a documentation patch. I don't believe the copyright >> assignment required for code contributions is required for contributions >> to the documentation. >> >> Best, >> >>> >>> Regards, >>> Andreas >>> >>> >>>> ? >>>> >>>> Cheers, >>>> >>>> Loris >>> >>>