[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Re: org tables and R
From: |
Dan Davison |
Subject: |
Re: [Orgmode] Re: org tables and R |
Date: |
Wed, 31 Dec 2008 20:51:50 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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:<lisp-list>
> > 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
--
http://www.stats.ox.ac.uk/~davison