From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Short Subject: Re: org tables and R Date: Fri, 2 Jan 2009 22:34:41 +0000 (UTC) Message-ID: References: <20081230193550.GA7961@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LIsbg-0006Nx-Qs for emacs-orgmode@gnu.org; Fri, 02 Jan 2009 17:35:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LIsbe-0006NA-RI for emacs-orgmode@gnu.org; Fri, 02 Jan 2009 17:35:03 -0500 Received: from [199.232.76.173] (port=57773 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LIsbe-0006N3-F5 for emacs-orgmode@gnu.org; Fri, 02 Jan 2009 17:35:02 -0500 Received: from main.gmane.org ([80.91.229.2]:53901 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LIsbe-0002HG-01 for emacs-orgmode@gnu.org; Fri, 02 Jan 2009 17:35:02 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LIsbW-0000mR-JG for emacs-orgmode@gnu.org; Fri, 02 Jan 2009 22:34:54 +0000 Received: from pool-70-18-103-134.alb.east.verizon.net ([70.18.103.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Jan 2009 22:34:54 +0000 Received: from tshort by pool-70-18-103-134.alb.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Jan 2009 22:34:54 +0000 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: emacs-orgmode@gnu.org Dan Davison stats.ox.ac.uk> writes: > There are more details below. The code is at > > http://www.stats.ox.ac.uk/~davison/software/org-table-R/org-table-R.el This is a neat way to interface to R and to make tables more useful to me. I'm a big user of ESS/R and org-mode, and I've been looking at ways to use them together more. If you want to input an org-mode table into R, here's one way to do it with Dan's TBLR: | col1 | col2 | |------+------| | 1 | 2 | | 3 | 4 | #+TBLR: replace:t #+TBLR:: my.table <<- x This assigns the table to the global variable "my.table" in R, and because we have "replace:t", it doesn't append the table with a copy of itself. That's a little kludgy, maybe an action to give the table a name could do that a bit more readily. If you want to reverse that and take an R table and put it into an org-mode table, you can do this: | | #+TBLR:: x <- r.table If you run "org-table-R-apply" with the cursor in the brackets above, it will produce the R variable "r.table" in an org-mode table following that statement. - Tom