emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: org tables and R


From: Tom Short
Subject: [Orgmode] Re: org tables and R
Date: Fri, 2 Jan 2009 22:34:41 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Dan Davison <davison <at> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]