From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: R code block produces only partial output Date: Sat, 09 Aug 2014 10:54:29 +0200 Message-ID: References: <87iom8zd24.fsf@gmail.com> <877g2oz9gv.fsf@gmail.com> <87lhr27oap.fsf@gmail.com> <87r40uwavs.fsf@gmail.com> <8761i5kg8f.fsf@gmail.com> <87ppgcrg8n.fsf@gmail.com> <87lhr0qimr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG2QB-0004co-NK for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 04:54:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XG2Q6-0001v6-0G for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 04:54:39 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:42863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG2Q5-0001uz-Nr for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 04:54:33 -0400 Received: by mail-wi0-f179.google.com with SMTP id f8so2033249wiw.12 for ; Sat, 09 Aug 2014 01:54:33 -0700 (PDT) In-Reply-To: (Charles C. Berry's message of "Thu, 7 Aug 2014 11:42:29 -0700") 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: "Charles C. Berry" Cc: Aaron Ecay , emacs-orgmode@gnu.org, Eric Schulte --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Charles C. Berry" writes: > On Thu, 7 Aug 2014, Aaron Ecay wrote: > >> Hi Chuck, >> >> Thanks for your feedback. >> >> 2014ko abuztuak 7an, "Charles C. Berry"-ek idatzi zuen: >>> Hi Aaron, >>> >>> I like what you are trying to do, but ... >>> >>> 1) The change has at least one bug: Remote sessions are broken by this >>> change. >>> >>> 2) The behavior of :results output is modified in ways that might not be >>> desired. i.e. warnings and errors will not show up in the output. >>> > > [snip issue 1 discussion] > >>> >>> Issue 2) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> ECM: >>> >>> #+NAME: aa >>> #+BEGIN_SRC R :session R2 :results output >>> warning("this is a warning") >>> 1+1 >>> #+END_SRC >>> >>> #+RESULTS: aa >>> : [1] 2 >>> >>> For some purposes having the warnings in the #+RESULTS: block is helpfu= l. >>> >>> And when revising code, having the errors in the #+RESULTS helps - >>> especially if I have to put aside work in progress. >> >> Hmm. Certainly, the previous behavior should be retained for now. In >> the longer term, I=E2=80=99d like to see a system whereby R errors trigg= er elisp >> errors. This is so that the execution of a whole document (subtree, >> etc.) will be halted by the first error, rather than continuing what may >> be a long series of commands that will not give valid output. What do >> you think? >> > > I need a while to sort through this. stop(), warning(), and message() > will print to the session but not show up in what capture.output > retains. > > sink() has the ability to capture those things, but there is added > baggage. > > I fear some study of ?conditions is needed. My knowledge of condition > handling in R is scant. > > As for stopping on error, I think that anything that changes current > behavior at this late date ought to be configurable. > > FWIW, when I export documents, I sometimes get innocuous errors that I > am happy did not stop the run in its tracks - like formatting one > table fails with an error but all else went through. And sometimes I > wish it had stopped. I agree here with Charles. An example where R errors do *not* trigger do not abort export are graphs: the graph generation, when using R, is wrapped in a tryCatch() block and shows the error in the exported document as well as in the R session but does not abort.=20 A case where it is very useful to continue export is when creating lecture notes or slides to demonstrate errors. If there is the wish for R errors to trigger elisp errors, a header argument would be needed to specify if errors and warnings in R should trigger errors in elisp or if they should be ignored and the error message displayed and the export should be continued. Cheers, Rainer > > Best, > > Chuck =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJT5eHFAAoJENvXNx4PUvmCMFoIAOuJE4VCB876v4+0m7lYKyqf XJc4UEoqUTbTdB73no0rgPU+33F92Vflx9OGf2GVyrPgVUwsi6BpHySHd9VodFwV NwrbHi4ldkL8SBuZW4ZRvtFTDTgiRiMithA48OOpTmzdrHjcpApDQl75obD8x6TS qW0kqDw9oQEyieRyjjXhvsldEIn4UKpMIeCKx2a2mlQWerpZOmWm6k26ySSxAWy9 QFgRwQIpyu2PQva1LBBhY4lwteDsBVFhckaP+FL672PgOnynJJcvMiCtUHIMUXpW lHxm9s6AGhWFABTomgiN7L9ig8iZPfll9+5Q6i9KNgyRcp/FUSQ6BRL8Asa0d0U= =hag2 -----END PGP SIGNATURE----- --=-=-=--