From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Tangle including code generating graphics for :results graphics Date: Thu, 24 Sep 2015 09:41:56 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf26Z-0008C3-QZ for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 04:42:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf26W-0005z5-I3 for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 04:42:15 -0400 Received: from plane.gmane.org ([80.91.229.3]:58802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf26W-0005yf-By for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 04:42:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zf26P-0002uk-RS for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 10:42:05 +0200 Received: from 193.63.221.9 ([193.63.221.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Sep 2015 10:42:05 +0200 Received: from andreas.leha by 193.63.221.9 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Sep 2015 10:42:05 +0200 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: emacs-orgmode@gnu.org Hi Rainer, Rainer M Krug writes: > Hi > > Is it possible to tangle an R code block including the code which is > generating the graphs when using =:results graphics= ? > > I would like to tangle these code blocks generating the graphs as I > would like to have a script which I can use to easily update all graphs > when the simulated input data is updated. I have this for the actual > analysis which works perfectly, but would like to have the same for the > graphs. At the same time, I like the clarity of specifying :width and > :height and other parameter for the plotting as header arguments. > > I have > > ,---- > | :PROPERTIES: > | :header-args+: :prologue "env <- fitBFGS; attach(env)" > | :header-args+: :epilogue "detach(env); rm(env)" > | :END: > `---- > > and this is tangled perfectly - but obviously not the code for > plotting. Is there an argument / setting to enable this? > > Thanks, > > Rainer That is a very relevant question and I'd be interested in the answer as well. But I am not aware of any support by Org mode for this. I guess calling `org-babel-expand-src-block' prior to tangling would answer your needs? This would be desirable not only for plotting code blocks, also data passed to code block is 'lost' during tangling. I think it would be good to have a source block header argument, say `:tangleexpanded', controlling such functionality. WDYT? Regards, Andreas