On Sat, Feb 16, 2013 at 12:24 AM, Bert Gunter <gunter.ber...@gene.com> wrote:
> As there has been no response to this ...
>
> Why not simply:
>
>> g <- substitute(f(x),list(f=function(x){x+1})) ## with curly braces
>> g
> function (x)
> {
>     x + 1
> }(x)
>> x <- 2
>> eval(g)
> [1] 3

Thomas Lumley sent me a similar suggestion off-list; but I'm not
complaining about how it works; my example executed fine. I'm
complaining that the rendering of the call object is misleading.

Hadley


-- 
Chief Scientist, RStudio
http://had.co.nz/

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to