[R-pkg-devel] Proper way to ask a user to set permanent variables?

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Wed Jan 15 23:47:34 CET 2020


Jonathan,

In all but one (maybe two?) of my packages I found relying on options()
sufficient. I usually follow the somewhat-common pattern of creating a
package-local environment in R/init.R or R/zzz.R. I then fill it with values
reflecting options() (often under a tag starting with the package name)
and/or environment variables, and sometime also provide 'setters' to update
the environment values. That have proven to be both good enough and rather
robust and, as an added benefit, does not depend on anything further.

Cheers, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list