emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: org-babel-R export parameters


From: Russell Adams
Subject: Re: [Orgmode] Re: org-babel-R export parameters
Date: Mon, 7 Jun 2010 05:31:00 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Jun 07, 2010 at 10:03:46AM +0100, Dan Davison wrote:
> Hi Russell,
> 
> Thanks, that's clear. You may well be right that it would be appropriate
> to expose further information about the babel source block
> (e.g. the :file argument) to the external language. However, one general
> design consideration is that where possible we do want to avoid
> implementing ad-hoc language-specific behaviour. If we do go your route
> I would suggest that everything should be wrapped up in a single list
> object (hash in perl, dict in python, etc etc), and that that list/hash
> object should have a reasonably consistent name across languages
> (__org_babel_header_args__ or something).

I already thought of that, but R was my target here. I didn't want to
jump into a major design decision. ;]


> For now however, I would suggest taking the view that what you are doing
> is slightly non-standard org-babel usage, and therefore that it should
> be achieved more explicitly. E.g. how about the following approach?
> 
> #+begin_src R :results file :var basename="myplot"
>   a <- 1:4
>   pngfile <- sprintf("%s.png", basename)
>   pdffile <- sprintf("%s.pdf", basename)
>   
>   png(pngfile)
>   plot(a)
>   dev.off()
>   
>   pdf(pdffile)
>   plot(a)
>   dev.off()
>   
>   pngfile
> #+end_src

I like this better, and I can use dev.copy here too. The issue is a
plot is rarely one line. Most of my plots are a half page of code
between the data set, legend, etc.

------------------------------------------------------------------
Russell Adams                            address@hidden

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]