Skip to content
Prev 343431 / 398506 Next

What the difference between .Golbalenv and package:base?

as.environment(characterString) maps an entry from the output of
search() to the environment at the named position in the search list.
as.environment(number) maps an index into the output of search() to
the the environment at that position in the search list.  If
'characterString' is not in the output of search() or 'number' is not
in seq_along(search()) then as.environment throws an error.  As far as
I can tell, as.environment does not deal with the name of the
environment at all.  (When you attach an environment, attach will add
a name attribute to the copied environment so the attached
environment's name matches the name on the output of search(), but I
don't think as.environment ever looks at that attribute.)

Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Aug 25, 2014 at 9:07 PM, PO SU <rhelpmaillist at 163.com> wrote: