[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Babel - simple getting started problem
From: |
Dan Davison |
Subject: |
Re: [Orgmode] Babel - simple getting started problem |
Date: |
Mon, 07 Dec 2009 12:12:15 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Graham Smith <address@hidden> writes:
> I know I must be missing the obvious here, but why can't I get babel+R
> to calculate a mean. See below
>
> Many thanks,
>
> Graham
>
> * test
> #+srcname:trial
> #+begin_src R
> x<-c(4,5,6,7,8,9)
> #+end_src
>
> #+resname: trial
> | 4 |
> | 5 |
> | 6 |
> | 7 |
> | 8 |
> | 9 |
>
>
> * meantest
> #+begin_src R
> mean(trial)
> #+end_src
Hi Graham,
Here's a version of your example that works.
Dan
* test
#+srcname:trial
#+begin_src R
c(4,5,6,7,8,9)
#+end_src
Note I deleted the 'x <-' there. Unless you're using :session there's
no point assigning to a variable which is not used.
#+results: trial
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
* meantest
#+srcname: calcmean(data=trial)
#+begin_src R
mean(data)
#+end_src
#+results: calcmean
: 6.5
or alternative syntax
#+begin_src R :var data=trial
mean(data)
#+end_src
#+results:
: 6.5
>
> #+resname:
>
> error in buffer "source block produced no output"
>
> * meantest2
> #+begin_src R
> mean(x)
> #+end_src
>
> #+resname:
>
> error in buffer "source block produced no output"
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode