From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: ob-R, problem with try/catch Date: Thu, 23 Apr 2015 17:42:19 +0100 Message-ID: <87k2x26bkk.fsf@gmail.com> References: <83477C11-94B6-467B-8CD5-77976FE83C31@gmail.com> <0A7B5324-A080-493C-AFAA-B597B3DD539E@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]:34362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlKCz-0000cW-BC for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 12:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlKCv-0002VE-4L for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 12:42:37 -0400 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:34182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlKCu-0002V0-T6 for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 12:42:33 -0400 Received: by wgso17 with SMTP id o17so24623496wgs.1 for ; Thu, 23 Apr 2015 09:42:31 -0700 (PDT) In-Reply-To: <0A7B5324-A080-493C-AFAA-B597B3DD539E@gmail.com> 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 , "Thomas S. Dye" Cc: Org-mode , "Charles C. Berry" Hello all, 2015ko apirilak 23an, Rainer M Krug-ek idatzi zuen: >> I'm picking up a project that I last worked on in 2013. I was under the >> impression that the source code blocks were working at that time, but I >> guess it is possible that I added the rm() statements after the code >> blocks were working and didn't realize that the addition broke them. >=20 > The rm() did not break anything. The behavior that if you want to have > a ggplot (and e.g. Lattice as well) in a pdf/png/... You have to use > print() is standard R behavior and was the same before. This question > question comes up from time to time on the R list as well. And I don't > think this can be easily be dealt with in org, as it is standard R. Before this change, the code was fed line-by-line to the R interpreter, and thus each line was auto printed. (Technically, the result of each expresion, whcih could span multiple lines.) After this change, the code is one expression, and only the result of the whole block is printed. Thus the different behavior. The previous behavior was not unproblematic. If a code block contained more than one plot, the results would have been odd: for a pdf device a multi-page pdf is generated. For jpg/png, several files are generated with a sequence number appended to each. The principled approach is to use the evaluate package for this. I had worked on a patch to move towards this approach, but the effort stalled when Charles Berry reported some regressions with remote sessions, which I was never able to reproduce (and thus fix) satisfactorily. The patch is here: . In any case, it is clear that one of the workarounds discussed in this thread should be used. Perhaps we should generate a warning for =E2=80=9C:results output graphics=E2=80=9D R code blocks, since they could = produce this strange situation. A priori, I expect that =E2=80=9C:results value graphics=E2=80=9D should be free from this problem. --=20 Aaron Ecay