View source: R/extract_soils_NRCS_SOLUS100.R
extract_soils_SOLUS100 | R Documentation |
SOLUS100
soil dataset
for SOILWAT2 applicationsExtract soil information from the SOLUS100
soil dataset
for SOILWAT2 applications
extract_soils_SOLUS100(
x,
crs = 4326,
vars = c("dbovendry", "fragvol", "sandtotal", "silttotal", "claytotal", "soc"),
var_depth = "resdept_cm",
depths = depth_profile_SOLUS100(),
stat = c("p", "l", "h", "rpi"),
path = ".",
method_vertical = c("asis", "interpolate_by_layer"),
requested_layer_depths = NULL,
method_horizontal = c("asis", "fix_with_buffer"),
fix_criteria = list(dbovendry = list(op = "<", value = 0.6), texture = list(op = "<",
value = 0.5)),
buffer_m = NULL,
fun = NULL,
na.rm = TRUE,
digits = 3L,
verbose = FALSE
)
x |
A numerical two-dimensional object
(a |
crs |
An object which is a crs or from which one can be derived.
|
vars |
A vector of variable names. See |
var_depth |
A character string or |
depths |
Soil depths in centimeters from surface.
See |
stat |
A vector of character strings. See Nauman et al. 2024 |
path |
A character string. The path to the local copy of |
method_vertical |
A character string that is
|
requested_layer_depths |
An integer vector
(used if |
method_horizontal |
A character string.
Method that determines the extraction approach across grid cells:
(i) values are extracted using arguments
|
fix_criteria |
A named list
(used if |
buffer_m |
A numeric value. The radius of a buffer around each point
from which to extract cell values and across which |
fun |
A function or a named list containing functions
(used if |
na.rm |
A logical value. Passed to |
digits |
An integer value. The number of digits to which soil texture
variables are rounded. Skip rounding if |
verbose |
A logical value. |
A local copy of SOLUS100
is required. The function
download_SOLUS100()
can be used to download SOLUS100
files.
Nauman, T. 2024.
Data from: Soil Landscapes of the United States 100-meter (SOLUS100
)
soil property maps project repository. Ag Data Commons.
https://doi.org/10.15482/USDA.ADC/25033856.V1.
terra::extract()
## Not run:
if (curl::has_internet()) {
path_solus100 <- tempdir()
req_vars <- c("resdept_cm", "sandtotal")
req_depths <- 0
## Download data
fns_solus100 <- rSW2exter::download_SOLUS100(
path = path_solus100,
vars = req_vars,
depths = req_depths
)
## Check that we have SOLUS100 data
has_SOLUS100 <- isTRUE(all(
check_SOLUS100(
path = path_solus100,
vars = req_vars,
depths = req_depths
)
))
if (has_SOLUS100) {
locations <- matrix(
data = c(-120.1286878, -111.8511136, 39.8182913, 36.9047396),
nrow = 2
)
## Extract gridcell values at point locations
res <- extract_soils_SOLUS100(
x = locations,
vars = req_vars,
depths = req_depths,
path = path_solus100
)
}
# Clean up example
unlink(file.path(path_solus100, fns_solus100))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.