From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bug passing tables to R code blocks? Date: Mon, 17 Oct 2011 22:45:43 -0400 Message-ID: <6364.1318905943@alphaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFzgd-0000bW-Ix for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 22:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFzgc-0002Mo-3P for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 22:45:51 -0400 Received: from g1t0029.austin.hp.com ([15.216.28.36]:31974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFzgb-0002MV-SV for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 22:45:50 -0400 In-Reply-To: Message from tsd@tsdye.com (Thomas S. Dye) of "Mon, 17 Oct 2011 16:05:01 -1000." 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: "Thomas S. Dye" Cc: nicholas.dokos@hp.com, Org-mode 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