On Fri, 17 Sep 2010, Greg Snow wrote:

I think what is going on (and someone is likely to correct me otherwise) is 
that formulas have an associated environment that gets passed along with them 
while character strings do not.


Yes.

model.frame(), which is called from most modelling functions, uses the data= 
argument as the first place to look up variables in the formula and the 
environment of the formula as the fallback location.

In the most common case, the environment of the formula is the environment from 
which the modelling function was called, so this is the same as using 
parent.frame(), but in more complex cases it is different.

    -thomas

Thomas Lumley
Professor of Biostatistics
University of Washington, Seattle

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to