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, 22 Mar 2011 21:03:14 -0600 Message-ID: <877hbqa66w.fsf@gmail.com> References: <20110320141946.67729b5b@bill.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=56395 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2EMp-0004Wj-E1 for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2EMo-0004zo-Ei for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:15 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:39870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2EMo-0004yz-9s for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:14 -0400 Received: by pwi10 with SMTP id 10so1531668pwi.0 for ; Tue, 22 Mar 2011 20:04:13 -0700 (PDT) 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 Hi Myles, I believe the problem here is that your :var header argument syntax is wrong. A :var header argument must have a name, and equals sign, and an assignment for the variable, e.g. #+begin_src sh :var name="eric" echo $name #+end_src #+results: : eric Please see the online manual for more information on the :var header argument. http://orgmode.org/manual/var.html#var Best -- Eric Myles English writes: > Hello, > > First of all thanks very much for all the very well explained help > given in previous threads I have started. > > Now, I have found different results arise from a difference in position > of parameters (I'm using commit c01c2ad Fri Mar 18, R version 2.12.20, > Feb 25): > > > #+TBLNAME: data > | x | parameter | value | > |---+-----------+-------| > | 0 | heat | 30 | > | 1 | heat | 30 | > > This next block works as I expect and returns the column names: > > #+source: namesNFirst > #+begin_src R :var N :var tbl :var param :colnames yes > names(tbl) > #+end_src > > #+call: namesNFirst(N=10,tbl=data,param="heat") > > #+results: namesNFirst(N=10,tbl=data,param="heat") > | x | > | parameter | > | value | > > Now, I would expect this to return the same result as above: > > #+source: namesNLast > #+begin_src R :var tbl :var param :var N :colnames yes > names(tbl) > #+end_src > > #+call: namesNLast(tbl=data,param="heat",N=10) > > but it doesn't: > > #+results: namesNLast(tbl=data,param="heat",N=10) > | X0 | > | heat | > | X30 | > > Removing the string parameter 'param', and again it works as expected: > > #+source: namesNoParam > #+begin_src R :var tbl :var N :colnames yes > names(tbl) > #+end_src > > #+call: namesNoParam(tbl=data,N=10) > > #+results: namesNoParam(tbl=data,N=10) > | x | > | parameter | > | value | > > I can't find any difference R-side when using :session. At this stage > I am asking for help; is this intended or a bug?. > > Thanks. > > Myles