From mboxrd@z Thu Jan 1 00:00:00 1970 From: Riccardo Romoli Subject: Re: Generating plot with org-babel-R Date: Mon, 6 Feb 2012 22:12:31 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00235452ef54d6ce3f04b8521eb5 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuVrW-00072j-O3 for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 16:12:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuVrU-0006hp-QC for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 16:12:34 -0500 Received: from mail-qy0-f169.google.com ([209.85.216.169]:49376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuVrU-0006h5-MW for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 16:12:32 -0500 Received: by qcsd16 with SMTP id d16so4035295qcs.0 for ; Mon, 06 Feb 2012 13:12:31 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: emacs-orgmode@gnu.org --00235452ef54d6ce3f04b8521eb5 Content-Type: text/plain; charset=ISO-8859-1 Hi Thomas, thanks a lot for your help!! Using the JSS and the org manual I solved all my problem (....at least for now!! :)) Best Riccardo 2012/2/5 Thomas S. Dye > Hi Riccardo, > > Thanks for the URL. Org mode has evolved since this article was > written. It should probably be revised or taken off Worg. I've copied > Eric Schulte, who is better able than me to determine the correct course > of action here. > > In the meantime, an up-to-date description of how Org mode can be used > to write literate programs has appeared in the Journal of Statistical > Software. You can find it here: http://www.jstatsoft.org/v46/i03 > > Perhaps you could use the examples in the JSS article to get started? > If these don't work for you, or if they raise questions that are difficult > to answer, please do come back to the list with your queries. > > All the best, > Tom > > Riccardo Romoli writes: > > > Hi, this is the URL: > > > > > http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html > > > > Best > > R > > > > 2012/2/5 Thomas S. Dye > > > >> Hi Riccardo, > >> > >> This code appears to be outdated. I don't recall this code on the org > >> site. Could you send a URL? > >> > >> All the best, > >> Tom > >> > >> Riccardo Romoli writes: > >> > >> > Hi, I'm trying to generate some figure with R, into an org session. > >> Firstly > >> > I use the code in the org site. The problem is that the code do not > >> > generate any figure. > >> > > >> > This is the code: > >> > > >> > #+TITLE:Test > >> > #+AUTHOR: Your Name > >> > #+EMAIL: your-email@server.com > >> > #+BABEL: :session *R* :cache yes :results output graphics :exports > >> > both :tangle yes > >> > > >> > * Example of Org-Babel for R Literate Programming > >> > ** R text output > >> > A simple summary. > >> > #+begin_src R > >> > x <- rnorm(10) > >> > summary(x) > >> > #+end_src > >> > > >> > ** R graphics output > >> > Note we use the object =x= generated in previous code block, thanks to > >> > the header option =:session *R*=. The output graphics file is > >> > =a.png=. > >> > > >> > #+begin_src R :file a.png > >> > y <- rnorm(10) > >> > plot(x, y) > >> > #+end_src > >> > > >> > Same plot with larger dimension: > >> > > >> > #+begin_src R :file b.png :width 800 :height 800 > >> > plot(x, y) > >> > #+end_src > >> > > >> > > >> > Where do I wrong? > >> > > >> > Best > >> > Riccardo > >> > Hi, I'm trying to generate some figure with R, into an org > session. > >> Firstly I use the code in the org site. The problem is that the code do > not > >> generate any figure. This is the code: > >> > #+TITLE:Test > >> > #+AUTHOR: Your Name > >> > #+EMAIL: mailto:your-email@server.com > >> > #+BABEL: :session *R* :cache yes :results output graphics :exports > both > >> :tangle yes > >> > > >> > * Example of Org-Babel for R Literate Programming > >> > ** R text output > >> > A simple summary. > >> > #+begin_src R > >> > x <- rnorm(10) > >> > summary(x) > >> > #+end_src > >> > > >> > ** R graphics output > >> > Note we use the object =x= generated in previous code block, thanks to > >> > the header option =:session *R*=. The output graphics file is > >> > =a.png=. > >> > > >> > #+begin_src R :file a.png > >> > y <- rnorm(10) > >> > plot(x, y) > >> > #+end_src > >> > > >> > Same plot with larger dimension: > >> > > >> > #+begin_src R :file b.png :width 800 :height 800 > >> > plot(x, y) > >> > #+end_src > >> > Where do I wrong?BestRiccardo > >> > >> -- > >> Thomas S. Dye > >> http://www.tsdye.com > >> > > Hi, this is the URL: > http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.htmlBestR > > 2012/2/5 Thomas S. Dye Hi > Riccardo, > > > > > > This code appears to be outdated. I don't recall this code on the > org > > site. Could you send a URL? > > > > All the best, > > Tom > > > > Riccardo Romoli writes: > > > >> Hi, I'm trying to generate some figure with R, into an org session. > Firstly > >> I use the code in the org site. The problem is that the code do not > >> generate any figure. > >> > >> This is the code: > >> > >> #+TITLE:Test > >> #+AUTHOR: Your Name > >> #+EMAIL: mailto:your-email@server.com > >> #+BABEL: :session *R* :cache yes :results output graphics :exports > >> both :tangle yes > >> > >> * Example of Org-Babel for R Literate Programming > >> ** R text output > >> A simple summary. > >> #+begin_src R > >> x <- rnorm(10) > >> summary(x) > >> #+end_src > >> > >> ** R graphics output > >> Note we use the object =x= generated in previous code block, thanks to > >> the header option =:session *R*=. The output graphics file is > >> =a.png=. > >> > >> #+begin_src R :file a.png > >> y <- rnorm(10) > >> plot(x, y) > >> #+end_src > >> > >> Same plot with larger dimension: > >> > >> #+begin_src R :file b.png :width 800 :height 800 > >> plot(x, y) > >> #+end_src > >> > >> > >> Where do I wrong? > >> > >> Best > >> Riccardo > >> Hi, I'm trying to generate some figure with R, into an org session. > Firstly I use the code in the org site. The problem is that the code do not > generate any figure. This is the code: > >> #+TITLE:Test > >> #+AUTHOR: Your Name > >> #+EMAIL: mailto:mailto:your-email@server.com > >> #+BABEL: :session *R* :cache yes :results output graphics :exports both > :tangle yes > >> > >> * Example of Org-Babel for R Literate Programming > >> ** R text output > >> A simple summary. > >> #+begin_src R > >> x <- rnorm(10) > >> summary(x) > >> #+end_src > >> > >> ** R graphics output > >> Note we use the object =x= generated in previous code block, thanks to > >> the header option =:session *R*=. The output graphics file is > >> =a.png=. > >> > >> #+begin_src R :file a.png > >> y <- rnorm(10) > >> plot(x, y) > >> #+end_src > >> > >> Same plot with larger dimension: > >> > >> #+begin_src R :file b.png :width 800 :height 800 > >> plot(x, y) > >> #+end_src > >> Where do I wrong?BestRiccardo > > > > -- > > Thomas S. Dye > > http://www.tsdye.com > > > > -- > Thomas S. Dye > http://www.tsdye.com > --00235452ef54d6ce3f04b8521eb5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Thomas,
thanks a lot for your help!! Using the JSS and the org manua= l I solved all my problem (....at least for now!! :))

Best
Riccar= do

2012/2/5 Thomas S. Dye <tsd@tsdye.com>
Hi Riccardo,

Thanks for the URL. =A0Org mode has evolved since this article was
written. =A0It should probably be revised or taken off Worg. =A0I've co= pied
Eric Schulte, who is better able than me to determine the correct course of action here.

In the meantime, an up-to-date description of how Org mode can be used
to write literate programs has appeared in the Journal of Statistical
Software. =A0You can find it here: http://www.jstatsoft.org/v46/i03

Perhaps you could use the examples in the JSS article to get started?
If these don't work for you, or if they raise questions that are diffic= ult
to answer, please do come back to the list with your queries.

All the best,
Tom

Riccardo Romoli <ric.romoli@gmai= l.com> writes:

> Hi, this is the URL:
>
> http://orgmode.org/worg/org-contrib/babel= /how-to-use-Org-Babel-for-R.html
>
> Best
> R
>
> 2012/2/5 Thomas S. Dye <tsd@tsdye.= com>
>
>> Hi Riccardo,
>>
>> This code appears to be outdated. =A0I don't recall this code = on the org
>> site. =A0Could you send a URL?
>>
>> All the best,
>> Tom
>>
>> Riccardo Romoli <ric.ro= moli@gmail.com> writes:
>>
>> > Hi, I'm trying to generate some figure with R, into an or= g session.
>> Firstly
>> > I use the code in the org site. The problem is that the code = do not
>> > generate any figure.
>> >
>> > This is the code:
>> >
>> > #+TITLE:Test
>> > #+AUTHOR: Your Name
>> > #+EMAIL: your-email@= server.com
>> > #+BABEL: :session *R* :cache yes :results output graphics :ex= ports
>> > both :tangle yes
>> >
>> > * Example of Org-Babel for R Literate Programming
>> > ** R text output
>> > A simple summary.
>> > #+begin_src R
>> > =A0 x <- rnorm(10)
>> > =A0 summary(x)
>> > #+end_src
>> >
>> > ** R graphics output
>> > Note we use the object =3Dx=3D generated in previous code blo= ck, thanks to
>> > the header option =3D:session *R*=3D. =A0The output graphics = file is
>> > =3Da.png=3D.
>> >
>> > #+begin_src R =A0:file a.png
>> > =A0 y <- rnorm(10)
>> > =A0 plot(x, y)
>> > #+end_src
>> >
>> > Same plot with larger dimension:
>> >
>> > #+begin_src R =A0:file b.png :width 800 :height 800
>> > =A0 plot(x, y)
>> > #+end_src
>> >
>> >
>> > Where do I wrong?
>> >
>> > Best
>> > Riccardo
>> > Hi, I&#39;m trying to generate some figure with R, into a= n org session.
>> Firstly I use the code in the org site. The problem is that the co= de do not
>> generate any figure. This is the code:
>> > #+TITLE:Test
>> > #+AUTHOR: Your Name
>> > #+EMAIL: mailto:your= -email@server.com
>> > #+BABEL: :session *R* :cache yes :results output graphics :ex= ports both
>> :tangle yes
>> >
>> > * Example of Org-Babel for R Literate Programming
>> > ** R text output
>> > A simple summary.
>> > #+begin_src R
>> > =A0 x <- rnorm(10)
>> > =A0 summary(x)
>> > #+end_src
>> >
>> > ** R graphics output
>> > Note we use the object =3Dx=3D generated in previous code blo= ck, thanks to
>> > the header option =3D:session *R*=3D. =A0The output graphics = file is
>> > =3Da.png=3D.
>> >
>> > #+begin_src R =A0:file a.png
>> > =A0 y <- rnorm(10)
>> > =A0 plot(x, y)
>> > #+end_src
>> >
>> > Same plot with larger dimension:
>> >
>> > #+begin_src R =A0:file b.png :width 800 :height 800
>> > =A0 plot(x, y)
>> > #+end_src
>> > Where do I wrong?BestRiccardo
>>
>> --
>> Thomas S. Dye
>> http://www.tsdy= e.com
>>
> 2012/2/5 Thomas S. Dye <span dir=3D"ltr"><mai= lto:tsd@tsdye.com></span>Hi R= iccardo,
>
>
> This code appears to be outdated. =A0I don&#39;t recall this code = on the org
> site. =A0Could you send a URL?
>
> All the best,
> Tom
>
> Riccardo Romoli <mailto:ric.romoli@gmail.com> writes:
>
>> Hi, I&#39;m trying to generate some figure with R, into an org= session. Firstly
>> I use the code in the org site. The problem is that the code do no= t
>> generate any figure.
>>
>> This is the code:
>>
>> #+TITLE:Test
>> #+AUTHOR: Your Name
>> #+EMAIL: mailto:your-emai= l@server.com
>> #+BABEL: :session *R* :cache yes :results output graphics :exports=
>> both :tangle yes
>>
>> * Example of Org-Babel for R Literate Programming
>> ** R text output
>> A simple summary.
>> #+begin_src R
>> =A0 x <- rnorm(10)
>> =A0 summary(x)
>> #+end_src
>>
>> ** R graphics output
>> Note we use the object =3Dx=3D generated in previous code block, t= hanks to
>> the header option =3D:session *R*=3D. =A0The output graphics file = is
>> =3Da.png=3D.
>>
>> #+begin_src R =A0:file a.png
>> =A0 y <- rnorm(10)
>> =A0 plot(x, y)
>> #+end_src
>>
>> Same plot with larger dimension:
>>
>> #+begin_src R =A0:file b.png :width 800 :height 800
>> =A0 plot(x, y)
>> #+end_src
>>
>>
>> Where do I wrong?
>>
>> Best
>> Riccardo
>> Hi, I&#39;m trying to generate some figure with R, into an org= session. Firstly I use the code in the org site. The problem is that the c= ode do not generate any figure. This is the code:
>> #+TITLE:Test
>> #+AUTHOR: Your Name
>> #+EMAIL: mailto:mailto:<= a href=3D"mailto:your-email@server.com">your-email@server.com
>> #+BABEL: :session *R* :cache yes :results output= graphics :exports both :tangle yes
>>
>> * Example of Org-Babel for R Literate Programming
>> ** R text output
>> A simple summary.
>> #+begin_src R
>> =A0 x <- rnorm(10)
>> =A0 summary(x)
>> #+end_src
>>
>> ** R graphics output
>> Note we use the object =3Dx=3D generated in previous code block, t= hanks to
>> the header option =3D:session *R*=3D. =A0The output graphics file = is
>> =3Da.png=3D.
>>
>> #+begin_src R =A0:file a.png
>> =A0 y <- rnorm(10)
>> =A0 plot(x, y)
>> #+end_src
>>
>> Same plot with larger dimension:
>>
>> #+begin_src R =A0:file b.png :width 800 :height 800
>> =A0 plot(x, y)
>> #+end_src
>> Where do I wrong?BestRiccardo
>
> <span class=3D"HOEnZb">--
> Thomas S. Dye
> http://www.tsdye.co= m
> </span>

--
Thomas S. Dye
http://www.tsdye.com=

--00235452ef54d6ce3f04b8521eb5--