Skip to content
Prev 4869 / 12125 Next

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

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