Skip to content
Prev 77979 / 398502 Next

Dummy quesion about environment

Thank you Peter,
for the comprehensive explanation. The reason I asked Does '"search" do it?' is that as I can run
ls(env=environment(h))
I can run 
ls(env=environment("package:methods"))
or ls("package:methods")
which I can see by search.
I thought maybe what I see by search is all the environments under .GobalEnv which I understan this is not what I see by search.
Thanks
Ron
"Ron Ophir" <ron.ophir at weizmann.ac.il> writes:
Well, there are special issues with x above, but the basic thing is to
take environment(h). Notice that h _is_ a function that _has_ an
associated environment.
[1] 10

As I said, x is stranger, which is because you used f() in the call:
symbol
[1] TRUE
Error in eval(expr, envir, enclos) : argument "x" is missing, with no
 default
[1] TRUE

You'll get the point if you look long and hard enough...
You can't. You can see the parent of an environment, the grandparent,
etc., but there is no way to see which children a given environment
has.
Huh?