emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] babel R: should/does order of parameters matter?


From: Eric Schulte
Subject: Re: [O] babel R: should/does order of parameters matter?
Date: Tue, 29 Mar 2011 10:33:48 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>
> #+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 via email to

[Prev in Thread] Current Thread [Next in Thread]