From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Pouzat Subject: Re: Selectively export RESULTS Date: Fri, 02 Mar 2012 18:59:22 +0100 Message-ID: <874nu6lw91.fsf@xtof-netbook.home> References: <87ty2aw7ps.fsf@tajo.ucsd.edu> <87ty29eg8n.fsf@tajo.ucsd.edu> <87boohbmch.fsf@gmx.com> <8762epz8uh.fsf@tajo.ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3WlR-0002xB-Qt for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 12:59:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3WlP-0008Gp-91 for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 12:59:33 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:49120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3WlP-0008CZ-0D for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 12:59:31 -0500 Received: by werj55 with SMTP id j55so1593595wer.0 for ; Fri, 02 Mar 2012 09:59:27 -0800 (PST) In-Reply-To: (Matthew Landis's message of "Fri, 2 Mar 2012 17:24:44 +0000 (UTC)") 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: Matthew Landis Cc: emacs-orgmode@gnu.org Matthew Landis writes: > tajo.ucsd.edu> writes: > >>=20 >> Eric Schulte gmx.com> writes: >>=20 >> >>> Does this do what you want? > >> > >> > Have you looked at the :cache header argument [1], from my understandi= ng >> > of your use case it should be exactly what you are after. >> > >>=20 >> Its a step in the right direction. >>=20 >> It seems I have to set :cache yes on every block I use before I invoke >> it. My attempt to use a buffer-wide PROPERTY setting for cache did not >> pan out.=20 >>=20 > > I'd like to put in a vote for the kind of functionality that cberry is=20 > describing. I have a very similar situation - a large org file that uses= R to=20 > do a lot of time consuming data manipulation and model fitting, resulting= in=20 > statistical tables and graphs. I run a lot of the code blocks as I'm wri= ting=20 > it, resulting in :results in the org file.=20=20 > > In the end, I'd like to export the org file to html or ODT, but I'd like = to be=20 > able to choose buffer-wide whether to rerun all of the code blocks or jus= t use=20 > the results that are already in the buffer. I tried setting #+PROPERTY: = eval no=20 > at the top of the buffer in the hopes that on export, it would ignore all= my=20 > code blocks and just incorporate the :results, but this was ignored and m= y code=20 > blocks were rerun. > > The cache argument only partially deals with the problem, as this example= =20 > illustrates: > > #+begin_src R :session :cache yes > x <- rnorm(100) > #+end_src > #+begin_src R :session :results graphics :exports results :file hist.png = :cache=20 > yes > hist(x) > #+end_src > > Now after the first export, I change code block 2, but not code block 1. = If I=20 > understand how cache works correctly, code block 2 will be rerun, but it = will=20 > fail because code block 1 is not rerun, so x doesn't exist in the R sessi= on.=20=20 > > For this reason, I'd prefer to be able to decide whether to re-run on a f= ile- > wide basis. > > Many thanks to all of you who have created such an amazing system.=20=20 > > M > Matthew, I think that you're wrongly expecting babel's cache header argument to behave like the argument of the same name in Sweave code chunks. Babel will cache, in your case, the value of your code block evaluation and there is none in your first code block, therefore nothing gets cached by babel, try that instead: #+name: my-random-vector #+begin_src R :session :cache yes rnorm(100) #+end_src #+headers: :var x=3Dmy-random-vector #+headers: :results graphics :exports results :file hist.png #+begin_src R :session :cache yes hist(x) #+end_src Does it work better? In that case you don't even need a session. Christophe --=20 Pr=C3=A9sident, Nicolas Sarkozy repr=C3=A9sente une sorte de triomphe bouff= on de l'=C3=A9galitarisme fran=C3=A7ais=C2=A0; pour la premi=C3=A8re fois d= e notre histoire, nous avons un chef de l'=C3=89tat qui se comporte comme s= 'il ne valait pas mieux que les citoyens. C'est en r=C3=A9alit=C3=A9 toujou= rs le cas, mais cette v=C3=A9rit=C3=A9 doit =C3=AAtre cach=C3=A9e pour que = les institutions et le syst=C3=A8me social tournent de fa=C3=A7on, si ce n'= est harmonieuse, du moins raisonnable. E. Todd, Apr=C3=A8s la d=C3=A9mocratie.=20 -- Christophe Pouzat MAP5 - Math=C3=A9matiques Appliqu=C3=A9es =C3=A0 Paris 5 CNRS UMR 8145 45, rue des Saints-P=C3=A8res 75006 PARIS France tel: +33142863828 mobile: +33662941034 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html