emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [babel] Specified colnames


From: Sebastien Vauban
Subject: Re: [O] [babel] Specified colnames
Date: Mon, 08 Apr 2013 21:45:34 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt)

Hi Eric,

Eric Schulte wrote:
> "Sebastien Vauban" <address@hidden> writes:
>> I'm trying to specify the column names of the table.
>>
>> #+name: input
>> | title | baz |
>> |-------+-----|
>> | obs1  | foo |
>> | obs2  | bar |
>>
>> But both versions (with symbols or strings) just do return the plain input
>> table.
>>
>> #+name: R-echo-colnames-list
>> #+begin_src R :var data=input :exports results :colnames '(Rev Author)
>> data
>> #+end_src
>>
>> #+name: R-echo-colnames-qlist
>> #+begin_src R :var data=input :exports results :colnames '("Rev" "Author")
>> data
>> #+end_src
>>
>> Am I doing something wrong?
>
> It looks like ob-R implements its own result table reconstruction
> instead of using the general support.  This is because R actually has a
> notion of column names and row names internally.  The implementation in
> ob-R does not correctly handle specified colnmaes as your example shows.
>
> The attached patch brings ob-R closer to the using the unified general
> table reconstructed used in most other languages, and fixes your problem
> mentioned above.  I haven't applied it however, as it may introduce
> other bugs related to specifying column names from within R.  For
> example, I'm not sure that it will now correctly apply column names from
> a table built entirely from within R.

Thanks for your help.

Extra question: tested with a sh block, both of the above do work, that is
with strings or symbols. Which one is supposed to be better (that is, will be
more portable with time), if there is one?

> Additional testing by someone more familiar with R than myself would be
> greatly appreciated.

Can't yet be that person, sadly. But time will come that...

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

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