From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Exporting output and graphics from R Date: Fri, 31 May 2013 14:25:08 +0200 Message-ID: <867gif5obf.fsf@somewhere.org> References: <86li6wvenc.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org SabreWolfy, SabreWolfy wrote: > Sebastien Vauban writes: >> AFAICT, you can't have both at the same time. Do you have a real >> use case for this? > > Maybe I'm not using the right tool for the job. I thought it would be useful > to be able to intersperse explanatory text with output: > > All crows are black. We know this from looking at crows. I analyzed a > dataset using this code, and produced a graph as follows: > > #+BEGIN_SRC R :results graphics :file testout.png :exports both > # load data, analyze, make graph > #+END_SRC > > The above analysis shows that all crows are black. A table of observed > results is as follows: > > #+BEGIN_SRC R :results > # more R code using the same dataset > # will only work if the dataset is loaded again > #+END_SRC ^^^^^^^^^^^^^^^^^^^^^^^ because you don't use the ":session" header argument. Look at it. > This can be summarized with the following results: > #+BEGIN_SRC R :results graphics :file testout.png :exports both > # R code plotting another graph and showing another output table > #+END_SRC Use ":noweb yes" and references to named code blocks. > My idea is that I would like the R code included for my reference when > reading the document. I would also like the explanatory text, etc. included, > as well as the output and results for the people who will be reading the > document. Of course, that's the whole point of using Org + Babel. Thanks Eric and Dan, once again... > Easier just to do it all in LaTeX directly? But then the code is not live, > like it is in Org. N/A Best regards, Seb -- Sebastien Vauban