This is a simple question but the answer is apparently not so simple... Is it possible to combine environments in R?
E1 = new.env() E2 = new.env() E1$x = 25 E2$y
You can do it by combining them, converting the environments to lists, and then converting back:
E3 <- as.environment(sapply(c(E1,E2),as.list)) ls(env=E3) [1] "x" "y" E3$x [1] 25 E3$y [1] 7