Open agila5 opened 2 weeks ago
The R 4.0.0 NEWS file says:
New function R_user_dir() in package tools suggests paths appropriate for storing R-related user-specific data, configuration and cache files.
For example, I currently see:
`tools::R_user_dir("osmextract", "data")` #> [1] "C:\\Users\\user\\AppData\\Roaming/R/data/R/osmextract"
I think that the ideas behind this function are somewhat related to the approach we currently use to detect where osmextract functions will save .osm and .gpkg files, i.e.
osmextract
.osm
.gpkg
https://github.com/ropensci/osmextract/blob/0eeacf8c725d66a93fec6e8ef9112178e6071db2/R/utils.R#L72-L78
Currently, we set the download directory as tempdir() whenever the OSMEXT_DOWNLOAD_DIRECTORY envvar is not set.
tempdir()
OSMEXT_DOWNLOAD_DIRECTORY
Does it make sense switching to tools::R_user_dir("osmextract", "data")?
tools::R_user_dir("osmextract", "data")
Cool! Yes could make sense to use that if there is now env var.
The R 4.0.0 NEWS file says:
For example, I currently see:
I think that the ideas behind this function are somewhat related to the approach we currently use to detect where
osmextract
functions will save.osm
and.gpkg
files, i.e.https://github.com/ropensci/osmextract/blob/0eeacf8c725d66a93fec6e8ef9112178e6071db2/R/utils.R#L72-L78
Currently, we set the download directory as
tempdir()
whenever theOSMEXT_DOWNLOAD_DIRECTORY
envvar is not set.Does it make sense switching to
tools::R_user_dir("osmextract", "data")
?