Skip to content
Prev 302524 / 398503 Next

Force evaluation of a symbol when a function is created

On Mon, Aug 6, 2012 at 9:03 PM, Schoenfeld, David
Alan,Ph.D.,Biostatistics <DSCHOENFELD at partners.org> wrote:
Disclaimer: I really have no idea what I'm talking about.

They are a somewhat subtle, but exceptionally powerful concept: see,
inter alia,

cran.r-project.org/doc/contrib/Fox-Companion/appendix-scope.pdf
http://www.lemnica.com/esotericR/Introducing-Closures/

If you know a little bit of C, it will go a long way in understanding
environments in R. You'll want to (eventually) start to associate R
names with C pointers and environments with symbol tables (hence the
fact the printed environment is just a memory address) , but that's
perhaps a little bit down the road. Environments are different in
their fundamental behavior because of this though: they're the best
way to get pass by reference in R.

Best,
Michael