[R] more environment questions

Edna Bell edna.bell01 at gmail.com
Tue Jul 29 18:12:17 CEST 2008


Hi R Gurus:

Here is some code that I was experimenting with, please:

> f1 <- function(x) {
+ e1 <- new.env(parent=.GlobalEnv)
+ environment(e1)
+ print(environment())
+ return(mean(x))
+ }
> f1(1:15)
<environment: 0x02525444>
[1] 8
>

My question:  why isn't the environment within the function set to e1, please?

Thanks,
Edna Bell



More information about the R-help mailing list