If I want to assign some variables into an environment, it seems
natural to do something like

e <- new.env()
within(e,
    {
      x <- 1:5
      y <- runif(5)
    }
)

This throws an error, since within.environment doesn't exist.  I
realise I can work around it using

as.environment(within(as.list(e),
    {
      x <- 1:5
      y <- runif(5)
    }
))

Just wondering why I can't use within directly with environments.

--
4dpiecharts.com

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

Reply via email to