opengeos / whiteboxR

WhiteboxTools R Frontend
https://whiteboxR.gishub.org
Other
168 stars 30 forks source link

use `tools::R_user_dir(package = "whitebox")` as default `install_whitebox()` / `wbt_exe_path()` directory #93

Closed brownag closed 1 year ago

brownag commented 1 year ago

This is an option that was not available in R when whitebox was originally developed. I think it is a better default than current find.package("whitebox") which gives the package folder in the library--which besides not technically being allowed, also results in annoying re-install WhiteboxTools if you re-install the R package, or if you upgrade R, or similar.

From CRAN repository policy:

For R version 4.0 or later (hence a version dependency is required or only conditional use is possible), packages may store user-specific data, configuration and cache files in their respective user directories obtained from tools::R_user_dir(), provided that by default sizes are kept as small as possible and the contents are actively managed (including removing outdated material).