30 Dec 20:35
org tables and R
From: Dan Davison <davison <at> stats.ox.ac.uk>
Subject: org tables and R
Newsgroups: gmane.emacs.orgmode
Date: 2008-12-30 19:35:50 GMT
Subject: org tables and R
Newsgroups: gmane.emacs.orgmode
Date: 2008-12-30 19:35:50 GMT
Hi all, I've had a go at taking the org tables and R thing a bit further. I'm using two different #+ lines in the org buffer: Lines starting with #+TBLR: are in the standard org style (option:value) and can be used to specify certain transformations of the table and standard plots of the table data. In lines starting #+TBLR:: you can supply literal R code, giving you full control over what you do with the table. M-x org-table-R-apply makes happen whatever has been specified in those lines. As long as the transformation results in something reasonably one- or two-dimensional, then this is output to the org-buffer as an org table (you can choose whether or not it replaces the original table). You need to have R running in an inferior-ess-mode buffer. Then, if you have this table, | rowname | col1 | col2 | |---------+------+------| | row 1 | 1 | 2 | | row 2 | 3 | 4 | | total | | | #+TBLR:: x[3,] <- x[1,] + x[2,] #+TBLR: rownames:1 org-table-R-apply turns it into | rownames(x) | col1 | col2 | |-------------+------+------| | row 1 | 1 | 2 | | row 2 | 3 | 4 | | total | 4 | 6 |(Continue reading)
RSS Feed