From: Dan Davison <davison@stats.ox.ac.uk>
To: Detlef Steuer <detlef.steuer@gmx.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] don't get the :result option
Date: Wed, 11 Nov 2009 12:06:25 -0500 [thread overview]
Message-ID: <87eio5j8j2.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <20091111141249.446c2dfc@gaia> (Detlef Steuer's message of "Wed, 11 Nov 2009 14:12:49 +0100")
Detlef Steuer <detlef.steuer@gmx.de> writes:
> Hi!
>
> Making my first steps with org babel I'm running into this:
>
> * R in org-mode
> May very well be the ultimate tool!
>
> #+srcname: R-first :results output
> #+begin_src R
> x <- runif(100)
> y <- x + rnorm(100)
> summary(lm(y ~x))
> #+end_src
Hi Detlef,
It took me a minute or two to spot the problem, but you've got
the :results header args on the wrong line. They go on the #+begin_src
line, not the #+srcname line (the latter is optional). With that change,
things work as expected. I hope you enjoy R with org-babel, and do let
us know if you have suggestions for improving it.
Dan
----------------------------------------------------------------
* R in org-mode
May very well be the ultimate tool!
#+srcname: R-first
#+begin_src R :results output
x <- runif(100)
y <- x + rnorm(100)
summary(lm(y ~x))
#+end_src
#+resname: R-first
#+begin_example
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-2.90755 -0.71151 0.05932 0.82393 1.96015
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.1439 0.2047 0.703 0.4836
x 0.7662 0.3365 2.277 0.0249 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.047 on 98 degrees of freedom
Multiple R-squared: 0.05025, Adjusted R-squared: 0.04056
F-statistic: 5.186 on 1 and 98 DF, p-value: 0.02495
#+end_example
#+begin_src R :results output
x <- runif(10)
#+end_src
#+resname:
----------------------------------------------------------------
>
> And I get "Source block produces no output" if I do C-c C-c.
> Nevertheless: in R summary() produces output.
>
> On the other hand:
>
> #+srcname: R-second :results output
> #+begin_src R
> x <- runif(10)
> #+end_src
>
> results in
> #+resname: R-second
> | 0.478928654454648 |
> | 0.635543955955654 |
> | 0.59639022895135 |
> | 0.152170182904229 |
> | 0.438571813516319 |
> | 0.116913777310401 |
> | 0.69362498424016 |
> | 0.629256698768586 |
> | 0.513565683504567 |
> | 0.0796801506076008 |
>
> Nevertheless that R command produces no output.
>
> I guess I'm doing wrongly something very simple.
> Can anybody help?
>
> This is with R-2.10.0 and org-mode freshly compiled this morning from git, emacs 22.
>
> Detlef
>
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
prev parent reply other threads:[~2009-11-11 17:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 13:12 [babel] don't get the :result option Detlef Steuer
2009-11-11 17:06 ` Dan Davison [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eio5j8j2.fsf@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=detlef.steuer@gmx.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.