Benjamin Tyner
2022-Nov-23 15:41 UTC
[R] .BaseNamespaceEnv locking in non-interactive mode
Greetings, Noticed that starting with R version 4.1.0, the base environment is locked by default. So for example in interactive mode, we have > .BaseNamespaceEnv$foo <- "bar" Error in .BaseNamespaceEnv$foo <- "bar" : ? cannot add binding of 'foo' to the base environment However it appears that when operating in non-interactive mode, the locking is not actually enforced: $ ~/R422/bin/Rscript -e "environmentIsLocked(.BaseNamespaceEnv)" [1] TRUE $ ~/R422/bin/Rscript -e ".BaseNamespaceEnv$foo <- 'bar'; .BaseNamespaceEnv$foo" [1] "bar" Just wondering if this is intentional, and if not, should I file a bug report? Regards, Ben