Detlef Steuer <detlef.ste...@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 _______________________________________________ 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