Re: [R] An argument processing puzzle --- solution.

2010-01-18 Thread Duncan Murdoch
On 18/01/2010 7:51 PM, Rolf Turner wrote: Thanks to Berton Gunter and Peter Ehlers who both effectively solved my problem. Prof. Gunter's solution, slightly more succinct, is: foo <- function(x) { if(is.name(sb <- substitute(x))) deparse(sb) else eval(sb) } (appropriately modified to fi

Re: [R] An argument processing puzzle --- solution.

2010-01-18 Thread Rolf Turner
Thanks to Berton Gunter and Peter Ehlers who both effectively solved my problem. Prof. Gunter's solution, slightly more succinct, is: foo <- function(x) { if(is.name(sb <- substitute(x))) deparse(sb) else eval(sb) } (appropriately modified to fit into the ``mv()'' context. Duncan Murdoch