From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [babel] Specified colnames Date: Mon, 08 Apr 2013 21:45:34 +0200 Message-ID: <86ip3w957l.fsf@somewhere.org> References: <86y5cuxfro.fsf@somewhere.org> <87obdp0ybb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, Eric Schulte wrote: > "Sebastien Vauban" 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