emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Babel-R TBLFM example


From: Shiyuan
Subject: [O] Babel-R TBLFM example
Date: Tue, 24 Jun 2014 23:55:46 -0700

Hi all, 
    I am looking at the Babel R example in 
http://orgmode.org/worg/org-tutorials/org-R/org-R.html

This short example show how to use code block in Org Tables. 
The example first makes an org-mode table, which I can follow and reproduce the result: 

#+name: tbl-example-data()
#+begin_src R 
runif(n=5, min=0, max=1)
#+end_src

#+RESULTS: tbl-example-data
|  0.118510485393927 |
|  0.742342338664457 |
|  0.438421099446714 |
| 0.0867570964619517 |
|  0.604204315226525 |

Then it defines r source code block and use TBLFM 

#+name: R-mean(x)
#+begin_src R 
mean(x)
#+end_src

#+RESULTS: R-mean

#+tblname: summaries
| mean   |
|--------|
| #ERROR |
#+TBLFM: @2$1='(sbe "R-mean" (x "tbl-example-data()"))

When I export to html(C-c C-e h o), the  #+TBLFM seems to be ignored and shows  no effect. When I place my cursor in the table and recalculate the table formula using C-u C-c C-c in the table. I got an error as shown above.   In the *Message* buffer, I can see the following messages.
byte-code: Beginning of buffer [8 times]
Re-applying formulas to full table...
Re-applying formula to field: @2$1
Re-applying formulas to full table...(line 1)
Re-applying formula to field: @2$1
Re-applying formulas to 1 lines...done
Re-applying formulas...done [2 times]

Any steps I missed? I am using org mode 8.2.6

Also, I found this tutorial for org-R http://orgmode.org/worg/org-tutorials/org-R/org-R.html, however, the org-R-apply function seems no longer available in my org mode 8.2.6. Is org-R supposed to be deprecated? 

Thanks. 

Shiyuan 

  

reply via email to

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