From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Re: org tables and R Date: Wed, 31 Dec 2008 20:51:50 +0000 Message-ID: <20081231205150.GA8779@stats.ox.ac.uk> References: <20081231084619.2353434807@mail2.panix.com> <1253.66.30.178.137.1230753269.squirrel@mail.panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LI833-0000Xe-W5 for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 15:52:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LI832-0000WH-8a for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 15:52:13 -0500 Received: from [199.232.76.173] (port=56707 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LI832-0000WE-4D for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 15:52:12 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:47781) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LI831-00067j-Jo for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 15:52:11 -0500 Content-Disposition: inline In-Reply-To: <1253.66.30.178.137.1230753269.squirrel@mail.panix.com> 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: "Tom Breton (Tehom)" Cc: emacs-orgmode@gnu.org Hi Tom, On Wed, Dec 31, 2008 at 02:54:29PM -0500, Tom Breton (Tehom) wrote: > > Dan writes: > [...] > > - replace:t > > The original org-table is replaced by the text output (which will be > > an org-table if the result is like a 1- or 2-dimensional array). > > Does replace:nil do the opposite? Yes. > > > - columns: > > This specifies the columns that the off-the-shelf action will > > operate on (e.g. the columns you want to plot). The simplest case > > is columns:j, where j is an integer. This could also be written > > columns:(j). columns:((1)(2 3)) says that you want a graphic in > > which columns 2 and 3 are plotted on the y-axis, and column 1 is > > plotted on the x-axis. [...] > > You might want to accept column names as well as column numbers. Sorry, I should have mentioned. You can already do that, without changes to the code. E.g. | author | date | |-----------------+---------------------------------| | Carsten Dominik | Thu, 12 Jun 2008 12:51:54 +0200 | | Carsten Dominik | Wed, 11 Jun 2008 08:57:39 +0200 | | Adam Spiers | Wed, 11 Jun 2008 12:06:23 +0100 | | Eddward DeVilla | Wed, 11 Jun 2008 12:15:11 -0500 | | Eddward DeVilla | Wed, 11 Jun 2008 20:09:50 -0500 | | Harri Kiiskinen | Wed, 04 Jun 2008 16:38:37 +0200 | | Carsten Dominik | Thu, 12 Jun 2008 14:15:49 +0200 | | Harri Kiiskinen | Thu, 12 Jun 2008 14:31:49 +0200 | #+TBLR: columns:("author" "date") action:tabulate #+TBLR:: x[,2] <- substr(x[,2], 1, 3) turns into | | Thu | Wed | |-----------------+-----+-----| | Adam Spiers | 0 | 1 | | Carsten Dominik | 2 | 1 | | Eddward DeVilla | 0 | 2 | | Harri Kiiskinen | 1 | 1 | and of course you can do it in the R code: | rowname | col1 | col2 | |---------+------+------| | row 1 | 1 | 2 | | row 2 | 3 | 4 | | total | | | #+TBLR:: x[3,] <- x["row 1",] + x["row 2",] #+TBLR: rownames:1 replace:nil turns into | rownames(x) | col1 | col2 | |-------------+------+------| | row 1 | 1 | 2 | | row 2 | 3 | 4 | | total | 4 | 6 | Dan > > Tom > > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- http://www.stats.ox.ac.uk/~davison