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

Jonathan Greenberg jgreenberg @end|ng |rom unr@edu
Tue Jan 14 17:06:51 CET 2020


Folks:

My package gdalUtils is a wrapper for a set of binaries on disk (the GDAL Utilities) -- these have about as many places to install as there are people installing it, and the system environment variables aren't always much help (they aren't always set) for locating them.  My package is trying to dummy-proof the usage as much as possible, so one of the things it does is if it can't find the install, it goes search for the install in, first, standard locations and runs a short test to see if the install is valid and, if not, goes on a longer hunt.  Right now, it does this search everytime someone boots up R and uses it, which slows down the process.

What I'm wondering is twofold:

1) Are there any packages/methods by which user "preferences" are saved that don't require saving workspaces (e.g. does R have a standardized "preferences" location that packages can use).

2) If the answer to #1 is "no", what is the preferred method for saving variables for use by packages that are always restored on boot -- e.g. I was thinking something like .Renviron but I think that's Rstudio only.  I'm concerned with workspace-type saves since I feel like that often results in a ton of variables being saved.

Thanks!

--j

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list