emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] don't get the :result  option
@ 2009-11-11 13:12 Detlef Steuer
  2009-11-11 17:06 ` Dan Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Detlef Steuer @ 2009-11-11 13:12 UTC (permalink / raw)
  To: emacs-orgmode

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

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
 

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

* Re: [babel] don't get the :result  option
  2009-11-11 13:12 [babel] don't get the :result option Detlef Steuer
@ 2009-11-11 17:06 ` Dan Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Davison @ 2009-11-11 17:06 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

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

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

end of thread, other threads:[~2009-11-11 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-11 13:12 [babel] don't get the :result option Detlef Steuer
2009-11-11 17:06 ` Dan Davison

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