emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Can't execute the introductory code: take table as input to produce


From: jenia mtl
Subject: [O] Can't execute the introductory code: take table as input to produce mean
Date: Tue, 5 Aug 2014 02:48:50 -0400

Hello:

I want to learn babel-mode so I'm going through http://orgmode.org/worg/org-contrib/babel/intro.html#source-code-blocks-org.

I'm trying to execute the basic tutorial's script and for some reason can't do it.

I'm suppose to feed a table as input to a function. This is the table:

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

    #+RESULTS: tbl-example-data
    |  0.607781215803698 |
    |  0.157157169422135 |
    |  0.675619817571715 |
    | 0.0488600700628012 |
    |  0.998780139256269 |

The next function is the function to be executed:


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

When I try to run it by pressing `C-c C-c`
I get `variable "x" in block "R-mean" must be assigned a default value`.


I tried to explicitly run the function R-mean(x) like so.

    #+call: R-mean(tbl-example-data)

Unfortunately I get

    Reference 'R-mean' not found in this buffer


How do I run the function R-mean using the vlaues from tbl-example-data?

Thanks in advance.

Jenia

reply via email to

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