From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: babel R: should/does order of parameters matter? Date: Tue, 29 Mar 2011 16:57:37 +0100 Message-ID: References: <20110320141946.67729b5b@bill.home> <877hbqa66w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=40542 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4bIb-0008BK-2S for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 11:57:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4bIZ-0001Jd-3C for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 11:57:40 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:48092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4bIY-0001J4-Uv for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 11:57:39 -0400 Received: by iwg8 with SMTP id 8so416017iwg.0 for ; Tue, 29 Mar 2011 08:57:37 -0700 (PDT) In-Reply-To: <877hbqa66w.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org Eric, On 23 March 2011 03:03, Eric Schulte wrote: > I believe the problem here is that your :var header argument syntax is > wrong. =C2=A0A :var header argument must have a name, and equals sign, an= d an > assignment for the variable, e.g. > > #+begin_src sh :var name=3D"eric" > =C2=A0echo $name > #+end_src > > #+results: > : eric Thanks for your reply, I think I deviated from the correct syntax while experimenting. After some more research I think I may have found either a bug or an omission from the manual. In order for R to assign column names to the resulting dataframe, an argument that is a table name must be the first argument at the point where a function is called from, whether it is executed directly (from within a source block) or by a #+call. The full org file that I believe verifies the above statement is http://pastebin.com/iixQdS0G , but to illustrate the issue: #+TBLNAME: data | x | parameter | value | |---+-----------+-------| | 0 | heat | 30 | | 1 | heat | 30 | #+source: func5 #+begin_src R :var name=3Ddata :var a=3D"one" :colnames yes names(name) #+end_src executing directly works as expected: #+results: func5 | x | |-----------| | x | | parameter | | value | try a basic call (ignores :colnames): #+call: func5(name=3Ddata, a=3D"two") #+results: func5(name=3Ddata, a=3D"two") | x | | parameter | | value | however, with the table argument last: #+call: func5(a=3D"two",name=3Ddata) #+results: func5(a=3D"two",name=3Ddata) | X0 | | heat | | X30 | of course I have also tried swapping the order of the arguments in the source block (and the #+calls) and the statement still stands. Is this confirmable as a bug or have I gone wrong again somewhere? Thanks, Myles