Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `.GlobalEnv` and `globalenv()`

Tags:

r

What is the difference? I read Hadley but this is not clear to me.
Furthermore, should I call it as envir=... or env=...? It seems it doesn't make a difference.
For examples see here and here.

like image 811
Christoph Avatar asked Mar 24 '26 00:03

Christoph


1 Answers

.GlobalEnv is a symbol to which the global environment is bound. globalenv is a function which returns the global environment. In practice, you can use both, although the former is faster by some nano-seconds.

Regarding your second question, study the language definition regarding argument matching, in particular, partial name matching.

like image 196
Roland Avatar answered Mar 25 '26 12:03

Roland