From: "Eric Schulte" <schulte.eric@gmail.com>
To: Myles English <mylesenglish@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: babel R: should/does order of parameters matter?
Date: Tue, 22 Mar 2011 21:03:14 -0600 [thread overview]
Message-ID: <877hbqa66w.fsf@gmail.com> (raw)
In-Reply-To: 20110320141946.67729b5b@bill.home
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 <mylesenglish@gmail.com> 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
next prev parent reply other threads:[~2011-03-23 3:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-20 14:19 babel R: should/does order of parameters matter? Myles English
2011-03-23 3:03 ` Eric Schulte [this message]
2011-03-29 15:57 ` Myles English
2011-03-29 16:33 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877hbqa66w.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mylesenglish@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).