Following the recent discussions here (e.g. 1, 2 ) I am now using environments in some of my code. My question is, how do I create functions that modify environments accordi
y <- new.env() with(y, x <- 1) f <- function(env,z) { with(env, x+z) } f(y,z=1)
mind the parentheses:) The following will work:
with(env, x)+z