> The substitute() function can do it, but the bquote() function is the most
> convenient:
>
>> foo <- function(s) {
> +   bquote(expression({
> +    v <- .(s)
> +    print(v)
> +   }))
> + }
>> foo(10)
> expression({
>   v <- 10
>   print(v)
> })
>
> Duncan Murdoch
>

Thanks, after sending this email, i used substitute, but first eval'ing
the formals (since they are delayed assignments).
I see bquote does this for me.


Regards
Saptarshi

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to