View source: R/extract_soils_POLARIS.R
check_POLARIS | R Documentation |
Check that POLARIS soil data are locally available
check_POLARIS(
path = ".",
vars = c("bd", "sand", "clay", "silt"),
stats = "mean"
)
path |
A character string. The path to the local copy of the
POLARIS folder hierarchy, e.g.,
|
vars |
A vector of character strings. See Chaney et al. 2019 |
stats |
A vector of character strings. See Chaney et al. 2019 |
A logical array with four dimensions:
"vrt" or "tif"; if "vrt" is missing, then "tif" are not checked.
Checks for each vars
.
Checks for each stats
.
Checks for each soil layer in POLARIS.
Chaney, N. W., B. Minasny, J. D. Herman, T. W. Nauman, C. Brungard, C. L. S. Morgan, A. B. McBratney, E. F. Wood, and Y. T. Yimam. 2019. POLARIS soil properties: 30-meter probabilistic maps of soil properties over the contiguous United States. Water Resources Research 55:2916-2938. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1029/2018WR022797")}.
script_to_download_polaris <- prepare_script_for_POLARIS()
## Execute script to download data
## (or set `path_polaris` to your local copy)
path_polaris <- dirname(script_to_download_polaris)
vars <- c("bd", "sand", "clay", "silt")
stat <- "mean"
## Check that we have POLARIS data
has_POLARIS <- check_POLARIS(path = path_polaris, vars = vars, stat = stat)
# Do we have all files?
isTRUE(all(has_POLARIS))
# If not, then examine
# (i) whether vrt files are missing, and/or
has_vrt <- !is.na(has_POLARIS["vrt", , , ]) & has_POLARIS["vrt", , , ]
# (ii) whether tif files are missing
has_tif <- !is.na(has_POLARIS["tif", , , ]) & has_POLARIS["tif", , , ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.