emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
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, 29 Mar 2011 10:33:48 -0600	[thread overview]
Message-ID: <87oc4trim0.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTikTrwSaMsaC3TgaebS7-ziNBi8JCc8Q-g1MPmrn@mail.gmail.com> (Myles English's message of "Tue, 29 Mar 2011 16:57:37 +0100")

>
> #+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

      reply	other threads:[~2011-03-29 16:35 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
2011-03-29 16:33     ` Eric Schulte [this message]

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=87oc4trim0.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).