From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: babel R: should/does order of parameters matter? Date: Tue, 29 Mar 2011 10:33:48 -0600 Message-ID: <87oc4trim0.fsf@gmail.com> References: <20110320141946.67729b5b@bill.home> <877hbqa66w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=35934 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4bsn-0001sI-Fa for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 12:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4bsm-0000Pb-Aj for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 12:35:05 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:48163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4bsm-0000PX-6S for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 12:35:04 -0400 Received: by iyf13 with SMTP id 13so462683iyf.0 for ; Tue, 29 Mar 2011 09:35:03 -0700 (PDT) In-Reply-To: (Myles English's message of "Tue, 29 Mar 2011 16:57:37 +0100") 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: Myles English Cc: emacs-orgmode@gnu.org > > #+TBLNAME: data > | x | parameter | value | > |---+-----------+-------| > | 0 | heat | 30 | > | 1 | heat | 30 | > > #+source: func5 > #+begin_src R :var name=data :var a="one" :colnames yes > names(name) > #+end_src > > executing directly works as expected: > > #+results: func5 > | x | > |-----------| > | x | > | parameter | > | value | > Agreed. > > try a basic call (ignores :colnames): > > #+call: func5(name=data, a="two") > > #+results: func5(name=data, a="two") > | x | > | parameter | > | value | > Yes, that is because the :colnames header argument applies to the original code block, but not to the call line. Pass the :colnames header argument to call line as follows #+call: func5(name=data, a="two") :colnames yes #+results: func5(name=data, a="two") | x | |-----------| | x | | parameter | | value | see http://orgmode.org/manual/Evaluating-code-blocks.html for information on the call line syntax > > however, with the table argument last: > > #+call: func5(a="two",name=data) > > #+results: func5(a="two",name=data) > | 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. > Hmm, now this is weird, the order of the arguments should matter to the call line, since they are named, they should map directly to the appropriate variable in the original code block. I'll have to look into this, thanks for bringing it up. > > Is this confirmable as a bug or have I gone wrong again somewhere? > The order of arguments issue is a bug, however the :colnames behavior is as expected (although the semantics of header arguments in call lines are admittedly tricky). Thanks -- Eric > > Thanks, > > Myles