[R-pkg-devel] Proper way to ask a user to set permanent variables?
Gábor Csárdi
c@@rd|@g@bor @end|ng |rom gm@||@com
Tue Jan 14 17:34:13 CET 2020
You can use the rappdirs package to look up the standard places for
permanent config, cache etc. files. E.g. on macOS:
❯ rappdirs::user_cache_dir()
[1] "/Users/gaborcsardi/Library/Caches"
Gabor
On Tue, Jan 14, 2020 at 4:10 PM Jonathan Greenberg <jgreenberg using unr.edu> wrote:
>
> 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]]
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
More information about the R-package-devel
mailing list