From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: BUG babel :colnames Date: Wed, 12 Feb 2014 00:08:00 +0100 Message-ID: <87bnyd459r.fsf@med.uni-goettingen.de> References: <87fvnp4wck.fsf@med.uni-goettingen.de> <871tz98ku6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDMRE-0000gL-W6 for emacs-orgmode@gnu.org; Tue, 11 Feb 2014 18:08:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDMR8-0002S4-7X for emacs-orgmode@gnu.org; Tue, 11 Feb 2014 18:08:24 -0500 Received: from plane.gmane.org ([80.91.229.3]:50113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDMR8-0002Rz-0j for emacs-orgmode@gnu.org; Tue, 11 Feb 2014 18:08:18 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WDMR6-00072K-MY for emacs-orgmode@gnu.org; Wed, 12 Feb 2014 00:08:16 +0100 Received: from vpn-2093.gwdg.de ([134.76.2.93]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Feb 2014 00:08:16 +0100 Received: from andreas.leha by vpn-2093.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Feb 2014 00:08:16 +0100 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Eric, thanks for looking into this. And thanks for the confirmation already! Good to know, that it is specific to R -- I had not checked. Of course, I do not want to use R to do mere subsetting, but rather some more complex processing, which I do not want to do in shell (or elisp,....) I have some more data on this bug if this is helpful: (1) On normal code blocks it depends on the order of the arguments. It seems to work for the last argument: --8<---------------cut here---------------start------------->8--- #+name: testtable2 | a | b | |---+---| | 1 | 3 | | 3 | 3 | | 4 | 1 | | 4 | 2 | #+header: :var testtable=testtable2 #+header: :var dummy=20 #+begin_src R :colnames yes testtable[2:3,] #+end_src #+results: | X1 | X3 | |----+----| | 4 | 1 | | 4 | 2 | #+header: :var dummy=20 #+header: :var testtable=testtable2 #+begin_src R :colnames yes testtable[2:3,] #+end_src #+results: | a | b | |---+---| | 3 | 3 | | 4 | 1 | --8<---------------cut here---------------end--------------->8--- (2) It is also buggy in call lines: --8<---------------cut here---------------start------------->8--- #+name: testtable2 | a | b | |---+---| | 1 | 3 | | 3 | 3 | | 4 | 1 | | 4 | 2 | #+name: process_testtable #+header: :var dummy=20 #+header: :var testtable=testtable2 #+begin_src R :colnames yes testtable[2:3,] #+end_src #+results: process_testtable | a | b | |---+---| | 3 | 3 | | 4 | 1 | #+call: process_testtable() :colnames yes #+results: | a | b | |---+---| | 3 | 3 | | 4 | 1 | #+call: process_testtable(dummy=24) :colnames yes #+results: | a | b | |---+---| | 4 | 1 | | 4 | 2 | #+call: process_testtable(dummy=24, testtable=testtable2) :colnames yes #+results: | X1 | X3 | |----+----| | 4 | 1 | | 4 | 2 | #+call: process_testtable(testtable=testtable2) :colnames yes #+results: | X1 | X3 | |----+----| | 4 | 1 | | 4 | 2 | --8<---------------cut here---------------end--------------->8--- Regards, Andreas Eric Schulte writes: > This bug looks to be specific to Babel's R support. E.g., it is not > present with shell code blocks. > > #+name: testtable2 > | a | b | > |---+---| > | 1 | 3 | > | 3 | 3 | > | 4 | 1 | > | 4 | 2 | > > #+header: :var testtable=testtable2 > #+begin_src sh :colnames yes > echo "$testtable"|tail -2 > #+end_src > > #+results: > | a | b | > |---+---| > | 4 | 1 | > | 4 | 2 | > > #+header: :var testtable=testtable2 > #+header: :var dummy=20 > #+begin_src sh :colnames yes > echo "$testtable"|tail -2 > #+end_src > > #+results: > | a | b | > |---+---| > | 4 | 1 | > | 4 | 2 | > > Best, > > Andreas Leha writes: > >> Hi all, >> >> there is a bug when it comes to babel not respecting :colnames when more >> variables are passed. >> >> Here is the MWE: >> >> --8<---------------cut here---------------start------------->8--- >> #+name: testtable2 >> | a | b | >> |---+---| >> | 1 | 3 | >> | 3 | 3 | >> | 4 | 1 | >> | 4 | 2 | >> >> #+header: :var testtable=testtable2 >> #+begin_src R :colnames yes >> testtable[2:3,] >> #+end_src >> >> #+results: >> | a | b | >> |---+---| >> | 3 | 3 | >> | 4 | 1 | >> >> #+header: :var testtable=testtable2 >> #+header: :var dummy=20 >> #+begin_src R :colnames yes >> testtable[2:3,] >> #+end_src >> >> #+results: >> | X1 | X3 | >> |----+----| >> | 4 | 1 | >> | 4 | 2 | >> --8<---------------cut here---------------end--------------->8--- >> >> >> Forgot to say in my last post: >> Org-mode version 8.2.5h (release_8.2.5h-581-g7b11ba.dirty @ /home/andreas/local/emacs/org-mode-install/lisp/) >> GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2013-12-22 on brahms, modified by Debian >> >> >> Regards, >> Andreas >> >>