emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Babel-R TBLFM example
@ 2014-06-25  6:55 Shiyuan
  2014-07-28 13:21 ` Bastien
  0 siblings, 1 reply; 9+ messages in thread
From: Shiyuan @ 2014-06-25  6:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2379 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-26  7:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  6:55 Babel-R TBLFM example Shiyuan
2014-07-28 13:21 ` Bastien
2014-07-29  6:15   ` Shiyuan
2014-07-29 13:20     ` Bastien
2014-08-24 23:02       ` Shiyuan
2014-08-25  7:51         ` Sebastien Vauban
2014-08-26  6:18           ` Shiyuan
2014-08-26  6:57             ` Thomas S. Dye
2014-08-26  7:23               ` Sebastien Vauban

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).