Gabor Grothendieck <[EMAIL PROTECTED]> writes:
> Thomas Lumley <tlumley <at> u.washington.edu> writes:
>
> > The distinction between "environment" and "frame" is important. The frame
> > is what you find things in with get(, inherits=FALSE) and the environment
> > uses get(, environment=TRUE).
>
> The thing I find odd about this one is that if we have:
>
> e <- new.env()
> e$x <- 1
> f <- new.env(parent=e)
> f$x # gives an error
(Actually not. I get NULL)
> then I would have expected x to be returned since f is an environment
> and x is in that environment. On the other hand, if an environment
> is defined to be the same as a frame (and there is some other word for
> an environment and its ancestors) then the above notation makes sense.
Why? f$x is documented to be basically equivalent to
get("x",f,inherits=FALSE). In contrast,
> evalq(x,f)
[1] 1
works fine.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html