soilDB_user_dir {soilDB} | R Documentation |
Get soilDB User Directory Path
Description
Wrapper around tools::R_user_dir()
for soilDB-specific file
storage in a platform-specific, user-level directory. Requires R >= 4.0.
These directories can be used for storing assets used as input to other soilDB functions, or for caching results to allow for offline use or fewer repeated requests to remote sources.
Use argument remove=TRUE
to delete files stored in the specified
directories.
Usage
soilDB_user_dir(
which = c("data", "config", "cache"),
...,
create = TRUE,
remove = FALSE,
fsep = .Platform$file.sep,
mustWork = NA
)
Arguments
which |
character. One of: |
... |
character. Sub-directories. Additional arguments are passed to
|
create |
logical. When |
remove |
logical. When |
fsep |
character. File path separator. Passed to |
mustWork |
logical. Throw error if path cannot be normalized; passed
to |
Details
If the directory path does not exist it is created (recursively)
when create=TRUE
. Output paths are normalized using
normalizePath()
and the specified path separator (fsep
).
Value
character. File paths within specified soilDB user directory. When
remove=TRUE
result is NULL
.
Author(s)
Andrew Gene Brown
Examples
soilDB_user_dir("data", c("dataset1", "dataset2"), "source", create = FALSE)