Skip to content
Prev 6079 / 63468 Next

is.environment, as.environment, and NULL

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
Implicitly at least, but ls("package:base") has been preferable for a
long time.
Nope...
It doesn't. NULL is the *base* environment i.e. the one at the very
end of the search path. This is what gives the mess where things like
evalq(foo(x), NULL) will find "foo" in base, but not in a package.
(One gotcha being that taking environment(formula) returns NULL if no
environment was ever set.)