[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Exporting output and graphics from R
From: |
Sebastien Vauban |
Subject: |
Re: [O] Exporting output and graphics from R |
Date: |
Fri, 31 May 2013 14:25:08 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (windows-nt) |
SabreWolfy,
SabreWolfy wrote:
> Sebastien Vauban <address@hidden> 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