From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Several graphs in R Date: Fri, 21 Jan 2011 14:35:44 +0000 Message-ID: References: <4D39672A.8070005@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=37297 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgI5q-0005Vj-Tx for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgI5o-0001AT-W0 for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:36:02 -0500 Received: from lo.gmane.org ([80.91.229.12]:55197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgI5o-0001AO-QG for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:36:00 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PgI5m-0003qX-KO for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 15:35:58 +0100 Received: from 94.197.132.141.threembb.co.uk ([94.197.132.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jan 2011 15:35:58 +0100 Received: from dandavison7 by 94.197.132.141.threembb.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jan 2011 15:35:58 +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: emacs-orgmode@gnu.org Rainer M Krug writes: > Hi > > I just solved a problem of mine, i.e. how to deal with multiple graphs > generated in an R script. > > OK - all are saved into separate pdfs in separate paths. But I would > like to see them after they are generated - and this is my solution: > > #+begin_src R :results output > path <- "./" > for (i in 1:10) { > fn <- paste(path, "/", "graph-", i, ".pdf", sep="") > pdf(fn) > try( > plot(runif(100)) > ) > dev.off() > cat("[[", fn, "]]\n", sep="") #<======= here it is! > } > #+end_src > > Then in the results bluck, there will be links to all pdfs. > > Thought this might help somebody. Hi Rainer, Cool. You might want to experiment with :results output raw :results output org also (I suspect that strictly speaking those links should not be functioning as links inside an example block). Feel free to add useful tricks like this to the babel R page: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html Dan > > Cheers, > > Rainer