Skip to content
Prev 343398 / 398506 Next

What the difference between .Golbalenv and package:base?

Tks for all your details, after your introduction, i really read the ?attach carefully, and i now understand the argument "pos" now, but in my opnion, the details in the function "attach" may do the as.environment(pos) for me.?
And i also understand that, "attach" will copy the attached envir,and add the copied envir into the search path list as you showed ?the examples to me.
After all, i want to ask a last question:
I notice that,
[1] "R_GlobalEnv"
<environment: R_GlobalEnv>
Error in as.environment("R_GlobalEnv") :?
? no item called "R_GlobalEnv" on the search list
<environment: R_GlobalEnv>
[1] ""
<environment: package:stats>
attr(,"name")
[1] "package:stats"
attr(,"path")
[1] "C:/Program Files/R/R-3.1.1/library/stats"


I am really confused now, while?as.environment("package:stats") can be work by convert the name of the environment stats, the?environmentName returns "" !
And get the .GlobalEnv from ".GlobalEnv" ,but can't form?"R_GlobalEnv" which is actually the name of the environment.
















--

PO SU
mail: desolator88 at 163.com 
Majored in Statistics from SJTU
At 2014-08-26 01:26:28, "John McKown" <john.archie.mckown at gmail.com> wrote: