From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Bug passing tables to R code blocks? Date: Tue, 18 Oct 2011 10:09:42 -0600 Message-ID: <87r52a2se1.fsf@gmail.com> References: <6364.1318905943@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGCEh-0003nC-Vf for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGCEc-00010t-6R for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:09:51 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:50932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGCEb-00010g-VV for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:09:46 -0400 Received: by iagf6 with SMTP id f6so1099852iag.0 for ; Tue, 18 Oct 2011 09:09:44 -0700 (PDT) In-Reply-To: <6364.1318905943@alphaville.dokosmarshall.org> (Nick Dokos's message of "Mon, 17 Oct 2011 22:45:43 -0400") 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: nicholas.dokos@hp.com Cc: Org-mode Nick Dokos writes: > Thomas S. Dye wrote: > >> Aloha all, >> >> I'm seeing some unexpected behavior when passing two tables into an R >> source code block. Things seem to work as expected when only one table is >> passed. >> >> In the following example, the header for the second table ends up on the >> first table when I evaluate the source code block. >> >> * R tables >> >> #+TBLNAME: tbl-1 >> | column1 | column2 | >> |---------+---------| >> | 45 | 34 | >> | 77 | 56 | >> >> #+tblname: tbl-2 >> | col1 | col2 | >> |------+------| >> | a | b | >> | c | d | >> >> #+BEGIN_SRC R :var x=tbl-1 :var y=tbl-2 :colnames yes >> x >> #+END_SRC >> >> #+results: >> | col1 | col2 | >> |------+------| >> | 45 | 34 | >> | 77 | 56 | >> >> release_7.7-396-g3538 >> Org-mode version 7.7 (release_7.7.396.g3538) >> >> Bug? Or my setup? >> > > Bug, I think: org-babel-disassemble-tables goes over tables from left to > right (top to bottom) but conses colnames (and rownames) to the front, > so they come out backwards. Reversing those two lists just before > org-babel-disassemble-tables returns should fix it. > Nick, thanks for diagnosing this problem your fix worked exactly as expected and I have just pushed it up to the Org-mode repository. Best -- Eric > > Nick > > > -- Eric Schulte http://cs.unm.edu/~eschulte/