|
|
@@ -1,10 +1,7 @@
|
|
|
#+TITLE: rorg --- R and org-mode
|
|
|
|
|
|
-Please feel free to change the layout of this file, I'm just putting
|
|
|
-this here to get things started.
|
|
|
-
|
|
|
* Objectives
|
|
|
-** Import data into R from org
|
|
|
+** Send data to R from org
|
|
|
Org-mode includes orgtbl-mode, an extremely convenient way of using
|
|
|
tabular data in a plain text file. Currently, spreadsheet
|
|
|
functionality is available in org tables using the emacs package
|
|
|
@@ -17,15 +14,43 @@ this here to get things started.
|
|
|
*** Implementations
|
|
|
**** naive
|
|
|
Naive implementation would be to use =(org-export-table "tmp.csv")=
|
|
|
- and =(ess-exec "read.csv('tmp.csv')")=.
|
|
|
+ and =(ess-execute "read.csv('tmp.csv')")=.
|
|
|
**** org-R
|
|
|
- [[file:existing_tools/org-R.el::defun%20org%20R%20export%20to%20csv%20csv%20file%20options][org-R-export-to-csv]]
|
|
|
+ org-R passes data to R from two sources: org tables, or csv
|
|
|
+ files. Org tables are first exported to a temporary csv file
|
|
|
+ using [[file:existing_tools/org-R.el::defun%20org%20R%20export%20to%20csv%20csv%20file%20options][org-R-export-to-csv]].
|
|
|
**** org-exp-blocks
|
|
|
**** RweaveOrg
|
|
|
NA
|
|
|
|
|
|
-** evaluate R code and make the output available for processing in an org buffer
|
|
|
-** evaluate R code and format the output for export
|
|
|
+** evaluate R code from org and deal with output appropriately
|
|
|
+*** vector output
|
|
|
+ When R code evaluation generates vectors and 2-dimensional arrays,
|
|
|
+ this should be formatted appropriately in org buffers (orgtbl-mode) as well
|
|
|
+ as in export targets (html, latex)
|
|
|
+**** Implementations
|
|
|
+***** org-R
|
|
|
+ org-R converts R output (vectors, or matrices / 2d-arrays) to an
|
|
|
+ org table and stores it in the org buffer, or in a separate org
|
|
|
+ file (csv output would also be perfectly possible).
|
|
|
+***** org-exp-blocks
|
|
|
+***** RweaveOrg
|
|
|
+*** graphical output
|
|
|
+ R can generate graphical output on a screen graphics device
|
|
|
+ (e.g. X11, quartz), and in various standard image file formats
|
|
|
+ (png, jpg, ps, pdf, etc). When graphical output is generated by
|
|
|
+ evaluation of R code in Org, at least the following two things are desirable:
|
|
|
+ 1. output to screen for immediate viewing is possible
|
|
|
+ 2. graphical output to file is linked to appropriately from the
|
|
|
+ org file This should have the automatic consequence that it is
|
|
|
+ included appropriately in subsequent export targets (html,
|
|
|
+ latex).
|
|
|
+**** Implementations
|
|
|
+***** org-R
|
|
|
+ org-R does (1) if no output file is specified and (2) otherwise
|
|
|
+***** org-exp-blocks
|
|
|
+***** RweaveOrg
|
|
|
+
|
|
|
|
|
|
* Notes
|
|
|
** Special editing and evaluation of source code in R blocks
|
|
|
@@ -33,7 +58,7 @@ this here to get things started.
|
|
|
In developing RweaveOrg, a third was introduced.
|
|
|
|
|
|
Eric is leaning towards using the =#+begin_src= blocks, as that is
|
|
|
- really what these blocks contain is source code. Austin believes
|
|
|
+ really what these blocks contain: source code. Austin believes
|
|
|
that specifying export options at the beginning of a block is
|
|
|
useful functionality, to be preserved if possible.
|
|
|
|