From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Bug passing tables to R code blocks? Date: Tue, 18 Oct 2011 08:44:31 -1000 Message-ID: References: <6364.1318905943@alphaville.dokosmarshall.org> <87r52a2se1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGEeZ-0006zu-KX for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 14:44:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGEeY-0000wk-7K for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 14:44:43 -0400 Received: from oproxy4-pub.bluehost.com ([69.89.21.11]:53551) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RGEeX-0000w5-Pm for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 14:44:42 -0400 In-Reply-To: <87r52a2se1.fsf@gmail.com> (Eric Schulte's message of "Tue, 18 Oct 2011 10:09:42 -0600") 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: Eric Schulte Cc: nicholas.dokos@hp.com, Org-mode Eric Schulte writes: > 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 >> >> >> Thanks Eric and Nick, This fixes the problem I was seeing. All the best, Tom -- Thomas S. Dye http://www.tsdye.com