From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] don't get the :result option Date: Wed, 11 Nov 2009 12:06:25 -0500 Message-ID: <87eio5j8j2.fsf@stats.ox.ac.uk> References: <20091111141249.446c2dfc@gaia> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8GeW-0001Dm-Sf for emacs-orgmode@gnu.org; Wed, 11 Nov 2009 12:06:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8GeS-000169-3B for emacs-orgmode@gnu.org; Wed, 11 Nov 2009 12:06:40 -0500 Received: from [199.232.76.173] (port=43028 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8GeR-00015l-Pb for emacs-orgmode@gnu.org; Wed, 11 Nov 2009 12:06:35 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:52858) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8GeR-0006fW-2j for emacs-orgmode@gnu.org; Wed, 11 Nov 2009 12:06:35 -0500 In-Reply-To: <20091111141249.446c2dfc@gaia> (Detlef Steuer's message of "Wed, 11 Nov 2009 14:12:49 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Detlef Steuer Cc: emacs-orgmode@gnu.org Detlef Steuer 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=20 > 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 =3D y ~ x) Residuals: Min 1Q Median 3Q Max=20 -2.90755 -0.71151 0.05932 0.82393 1.96015=20 Coefficients: Estimate Std. Error t value Pr(>|t|)=20=20 (Intercept) 0.1439 0.2047 0.703 0.4836=20=20 x 0.7662 0.3365 2.277 0.0249 * --- Signif. codes: 0 =E2=80=98***=E2=80=99 0.001 =E2=80=98**=E2=80=99 0.01 =E2= =80=98*=E2=80=99 0.05 =E2=80=98.=E2=80=99 0.1 =E2=80=98 =E2=80=99 1=20 Residual standard error: 1.047 on 98 degrees of freedom Multiple R-squared: 0.05025, Adjusted R-squared: 0.04056=20 F-statistic: 5.186 on 1 and 98 DF, p-value: 0.02495=20 #+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=20 > 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 >=20=20 > > > > > _______________________________________________ > 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