Downloads both the database and gridded HWSD v2.0 data products to a desired output path for subsetting.
the path / directory where to store the HWSD v2.0 database
verbose messaging of downloading and managing the gridded data file
current data path
When an existing path is used which is not the temporary directory an environmental variable WS_PATH can be set by creating an ~/.Renviron file using usethis::edit_r_environ() and entering the path as:
WS_PATH = "/your/full/path"
This variable will override the default temporary directory if it exists. This allows the gridded data to be stored elsewhere and be forgotten (while using the hwsdr package for HWSD v2.0).
Should you delete the gridded file, the environmental variable should be altered and set again by editting the ~/.Renviron file to a new location.
if (FALSE) {
# Download the gridded soil map of
# HWSD v2.0 to the temporary directory
ws_download()
# download the same data to a specific
# directory (which should exist)
ws_download(
ws_path = "~/my_path"
)
# download the same data to a specific
# directory (which should exist) and
# update the environmental variable
ws_download(
ws_path = "~/my_path",
verbose = TRUE
)
}