emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Myles English <mylesenglish@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: babel R: should/does order of parameters matter?
Date: Tue, 29 Mar 2011 16:57:37 +0100	[thread overview]
Message-ID: <AANLkTikTrwSaMsaC3TgaebS7-ziNBi8JCc8Q-g1MPmrn@mail.gmail.com> (raw)
In-Reply-To: <877hbqa66w.fsf@gmail.com>

Eric,

On 23 March 2011 03:03, Eric Schulte <schulte.eric@gmail.com> wrote:
> 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

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=data :var a="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=data, a="two")

#+results: func5(name=data, a="two")
| x         |
| parameter |
| value     |

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.

Is this confirmable as a bug or have I gone wrong again somewhere?

Thanks,

Myles

  reply	other threads:[~2011-03-29 15:57 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
2011-03-29 15:57   ` Myles English [this message]
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=AANLkTikTrwSaMsaC3TgaebS7-ziNBi8JCc8Q-g1MPmrn@mail.gmail.com \
    --to=mylesenglish@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@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).