[Rd] Create an environment and assign objects to it in one go?

From: Henrik Bengtsson <hb_at_biostat.ucsf.edu>
Date: Wed, 09 Mar 2011 23:44:40 -0800


Hi,

I've just created:

newEnvEval <- function(..., hash=FALSE, parent=parent.frame(), size=29L) {   envir <- new.env(hash=hash, parent=parent, size=size);   evalq(..., envir=envir);
  envir;
} # newEnvEval()

so that I can create an environment and assign objects to it in one go, e.g.

env <- newEnvEval({ a <- 1; b <- 2; });
print(env$a);

Does this already exists somewhere?

/Henrik

PS.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 10 Mar 2011 - 07:48:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Mar 2011 - 15:50:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive