check_Miller1998_CONUSSoil: Check that CONUSSoil soil data are locally available

View source: R/extract_soils_Miller1998_CONUSSoils.R

check_Miller1998_CONUSSoilR Documentation

Check that CONUSSoil soil data are locally available

Description

Check that CONUSSoil soil data are locally available

Usage

check_Miller1998_CONUSSoil(
  path = ".",
  vars = c("rockdepm", "rockvol", "bd", "sand", "clay", "silt"),
  lower_limits_by_vars = c(rockdepm = 0, rockvol = 0, bd = 30, sand = 0, clay = 0, silt =
    0)
)

Arguments

path

A character string. The path to the local copy of the CONUSSoil folder hierarchy, e.g., dirname(prepare_script_for_Miller1998_CONUSSoil()).

vars

A vector of character strings. The requested variables as used by CONUSSoil; see Miller et al. 1998.

lower_limits_by_vars

A named numeric vector. The names correspond to vars and values represent the lower limits that are conditioned/ masked out, i.e., set to NA.

Value

A logical vector of the length of vars.

References

Miller, D. A., and R. A. White. 1998. A conterminous United States multilayer soil characteristics dataset for regional climate and hydrology modeling. Earth Interactions 2:1-26. http://www.soilinfo.psu.edu/index.cgi?soil_data&conus

Examples

script_to_download_conussoil <- prepare_script_for_Miller1998_CONUSSoil()

## Execute script to download data
## (or set `path_conussoil` to your local copy)
path_conussoil <- dirname(script_to_download_conussoil)

## Mask out unrealistic variable values
has_CONUSSoil_cond <- create_conditioned_Miller1998_CONUSSoil(
  path = path_conussoil
)

## Check that we have CONUSSoil data
has_CONUSSoil <- check_Miller1998_CONUSSoil(path = path_conussoil)

# Do we have all files?
isTRUE(all(has_CONUSSoil))

# If not, then examine which variables are missing
has_CONUSSoil


DrylandEcology/rSW2exter documentation built on May 4, 2024, 10:53 p.m.