emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Rainer M Krug <r.m.krug@gmail.com>, "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org-mode <emacs-orgmode@gnu.org>, "Charles C. Berry" <ccberry@ucsd.edu>
Subject: Re: ob-R, problem with try/catch
Date: Thu, 23 Apr 2015 17:42:19 +0100	[thread overview]
Message-ID: <87k2x26bkk.fsf@gmail.com> (raw)
In-Reply-To: <0A7B5324-A080-493C-AFAA-B597B3DD539E@gmail.com>

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.
> 
> 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: <http://mid.gmane.org/87k35orl2w.fsf@gmail.com>.

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
“:results output graphics” R code blocks, since they could produce
this strange situation.  A priori, I expect that “:results value
graphics” should be free from this problem.

-- 
Aaron Ecay

  reply	other threads:[~2015-04-23 16:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 22:03 ob-R, problem with try/catch Thomas S. Dye
2015-04-23  2:23 ` Charles C. Berry
2015-04-23  5:40   ` Rainer M Krug
2015-04-23 15:53     ` Thomas S. Dye
2015-04-23 16:20       ` Rainer M Krug
2015-04-23 16:42         ` Aaron Ecay [this message]
2015-04-23 16:13     ` Charles C. Berry
2015-04-23 16:29       ` Rainer M Krug
2015-04-23 17:11         ` Thomas S. Dye
2015-04-23 22:39           ` Aaron Ecay
2015-04-23 23:36             ` Thomas S. Dye
2015-04-26 12:49         ` Nicolas Goaziou
2015-04-26 17:11           ` Charles C. Berry
2015-04-26 17:28             ` Nicolas Goaziou
2015-05-04  8:35             ` Rainer M Krug
2015-05-04 19:03               ` Nicolas Goaziou
2015-04-23  6:35   ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2x26bkk.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@gmail.com \
    --cc=tsd@tsdye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).