Hi Rainer, Rainer M Krug <rai...@krugs.de> 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