emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: "Tom Breton (Tehom)" <tehom@panix.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: org tables and R
Date: Wed, 31 Dec 2008 20:51:50 +0000	[thread overview]
Message-ID: <20081231205150.GA8779@stats.ox.ac.uk> (raw)
In-Reply-To: <1253.66.30.178.137.1230753269.squirrel@mail.panix.com>

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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

-- 
http://www.stats.ox.ac.uk/~davison

      reply	other threads:[~2008-12-31 20:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081231084619.2353434807@mail2.panix.com>
2008-12-31 19:54 ` org tables and R Tom Breton (Tehom)
2008-12-31 20:51   ` Dan Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081231205150.GA8779@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=tehom@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).