[R] Creating a series of new environments

Karl Ove Hufthammer Karl.Hufthammer at math.uib.no
Fri May 30 16:03:53 CEST 2008


Powell, Jeff:

> I would like to be able to do something like the following:
> nms <- c("en1", "en2", "en3", ...)
> 
> for(i in nms) i <- new.env(parent = .GlobalEnv)

Try

  for(i in nms) assign(i, new.env(parent = .GlobalEnv))

-- 
Karl Ove Hufthammer



More information about the R-help mailing list