Hi Aaron,

Aaron Ecay <aarone...@gmail.com> writes:

> Hi Tom,
>
> 2015ko apirilak 23an, "Thomas S. Dye"-ek idatzi zuen:
>> 
>> IIRC :results output graphics is needed for the ggplot package.
>
> Hmm.  This is the case if the code is *not* evaluated in a session.  In
> a session, either value or output result types work.  (All this has been
> tested with a recent master version.)

Yes, indeed.  I'd forgotten this distinction, which Erik Iverson spelled
out clearly several years ago:
http://article.gmane.org/gmane.emacs.orgmode/26082

Unless Erik minds, I'll work his post into ob-doc-R when I find some
time.  IMO, it would be nice to have this kind of systematic description
in the first place one goes for help.

> An unfortunate situation – IMO
> the value type ought to work outside of a session, provided that the
> value of the last expression in the block is a ggplot object.
>
> Here’s a code block that can be adapted to test various combinations:
>
> #+begin_src R :results output graphics :file foo.png :session *foo*
>   library(ggplot2)
>   ggplot(data.frame(x = rnorm(10), y = rnorm(10)),
>          aes(x = x, y = y)) +
>     geom_point()
> #+end_src

Thanks, this code will be useful as I pick up this project, which was
the first time I tried to do something substantial with Org mode.  I'm
going to find a ton of cruft ...

All the best,
Tom

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

Reply via email to