From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Babel trouble: column names, arguments, and R dataframes Date: Fri, 21 Jan 2011 13:36:47 +0100 Message-ID: <4D397DDF.9070106@christianmoe.com> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=42452 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgGCN-0001s2-1g for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 07:34:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgGCM-000052-0I for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 07:34:38 -0500 Received: from mars.hitrost.net ([91.185.211.18]:39282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgGCL-0008Qk-PA for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 07:34:37 -0500 Received: from lk.92.63.17.213.dc.cable.static.lj-kabel.net ([92.63.17.213] helo=Celebrian.local) by mars.hitrost.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.73) (envelope-from ) id 1PgGBo-00085b-I2 for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 13:34:04 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Hi, I'm having odd troubles with reading tables into R as dataframes with named vectors. Unfortunately I have difficulties pinning down a consistent problematic behavior. But one weird example follows below: I have two tables, data1 and data2. The first test reads data1 in as a dataframe named `values', and returns that dataframe, spitting out the identical table again. This is the behavior I expect. The second test passes both tables as arguments. It's supposed to return the first table, just as the first test did -- and it returns the correct values, but the column names have been swapped with those in the second table! The third test, similarly, returns the second table, but with the colum names of the first table. Any hints? Yours, Christian #+tblname: data1 | Year | Value | |------+-------| | 2000 | 34 | | 2001 | 55 | | 2002 | 24 | #+tblname: data2 | Yr | Rate | |------+------| | 2000 | 1.10 | | 2001 | 1.05 | | 2002 | 1.12 | #+source: try1(values=data1) #+begin_src R :colnames yes values #+end_src #+results: try1 | Year | Value | |------+-------| | 2000 | 34 | | 2001 | 55 | | 2002 | 24 | #+source: try2(values=data1, rates=data2) #+begin_src R :colnames yes values #+end_src #+results: try2 | Yr | Rate | |------+------| | 2000 | 34 | | 2001 | 55 | | 2002 | 24 | #+source: try3(values=data1, rates=data2) #+begin_src R :colnames yes rates #+end_src #+results: try3 | Year | Value | |------+-------| | 2000 | 1.1 | | 2001 | 1.05 | | 2002 | 1.12 |