From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: ob-R, problem with try/catch Date: Thu, 23 Apr 2015 13:36:41 -1000 Message-ID: References: <83477C11-94B6-467B-8CD5-77976FE83C31@gmail.com> <0A59ABA8-865B-44CE-823A-0CC168983981@gmail.com> <87h9s65v0x.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlQfz-000238-KM for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 19:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlQfw-0006t5-V3 for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 19:36:59 -0400 Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:33964) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1YlQfw-0006t0-O0 for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 19:36:56 -0400 In-Reply-To: <87h9s65v0x.fsf@gmail.com> (Aaron Ecay's message of "Thu, 23 Apr 2015 23:39:42 +0100") 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: Rainer M Krug Cc: Org-mode , "Charles C. Berry" Hi Aaron, Aaron Ecay writes: > Hi Tom, > > 2015ko apirilak 23an, "Thomas S. Dye"-ek idatzi zuen: >>=20 >> 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 =E2=80=93 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=E2=80=99s a code block that can be adapted to test various combinati= ons: > > #+begin_src R :results output graphics :file foo.png :session *foo* > library(ggplot2) > ggplot(data.frame(x =3D rnorm(10), y =3D rnorm(10)), > aes(x =3D x, y =3D 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 --=20 Thomas S. Dye http://www.tsdye.com