-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
Description
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.
Lines 72 to 78 in 0eeacf8
| oe_download_directory = function() { | |
| download_directory = Sys.getenv("OSMEXT_DOWNLOAD_DIRECTORY", tempdir()) | |
| if (!dir.exists(download_directory)) { | |
| dir.create(download_directory) # nocov | |
| } | |
| normalizePath(download_directory) | |
| } |
Currently, we set the download directory as tempdir() whenever the OSMEXT_DOWNLOAD_DIRECTORY envvar is not set.
Does it make sense switching to tools::R_user_dir("osmextract", "data")?