|
|
|
|
|
by kgwgk
2017 days ago
|
|
The lambda thing may be useful. Sometimes I was tempted to do something like this > f <- function(expr) eval(substitute( function(x) expr ))
> sapply(1:4, f({ a <- x^2 ; b <- x^3 ; a+b }))
[1] 2 12 36 80
but I'm not sure it would have worked well. The new syntax is of course also more flexible. |
|