[Rd] Rprofile.site function or variable definitions break with R 4.1

Andrew Piskorski @tp @end|ng |rom p|@kor@k|@com
Thu Aug 12 21:19:44 CEST 2021


With R 4.1, it seems you can no longer do much in your "Rprofile.site"
file.  Attempting to define any functions or set any variables there
gives errors like these:

  Error: cannot add binding of 'my_function_name' to the base environment
  Error: cannot add binding of 'my_variable_name' to the base environment

Presumably that's because of this change in R 4.1.0:

  https://cran.r-project.org/doc/manuals/r-patched/NEWS.html
  CHANGES IN R 4.1.0
  The base environment and its namespace are now locked (so one can no
  longer add bindings to these or remove from these).

Ok, but what's the recommended way to actually USE Rprofile.site now?
Should I move all my local configuration into a special package, and
do nothing in Rprofile.site except require() that package?

Thanks for your help and advice!

-- 
Andrew Piskorski <atp using piskorski.com>



More information about the R-devel mailing list