View source: R/extract_soils_NRCS_SDA.R
calculate_soil_depth_NRCS | R Documentation |
Determine soil depth for NRCS soil data
calculate_soil_depth_NRCS(
x,
target_site_ids,
restrict_by_ec_or_ph = TRUE,
var_site_id = "COKEY",
var_horizon = "Horizon_No",
var_horizon_lower_depth = "hzdepb_r",
var_restrictions = c("Horizon_depth", "RootZoneRestriction_depth", "Bedrock_depth"),
var_soiltexture = c("sand", "clay", "silt")
)
x |
A |
target_site_ids |
A vector. The unique location identifiers, e.g., cokey values, for which soil depth is to be determined. |
restrict_by_ec_or_ph |
A logical value. Include depth restrictions
by |
var_site_id |
A character string. The column name of |
var_horizon |
A character string. The column name of |
var_horizon_lower_depth |
A character string. The column name of
|
var_restrictions |
A vector of character strings. The column names of
|
var_soiltexture |
A vector of character strings. The column names of
|
A data.frame
with at least three columns. Each row represents
one value of target_cokeys
. The columns are:
N_horizons: The number of soil horizons/layers.
SoilDepth_cm: The soil depth in centimeters.
depth_Lx: The lower depth of soil horizon/layer x.
Note: depth_L1 may vary from x[, "hzdepb_r"]
.
Code based on CalcRZDepth() version 2020-08-31: https://github.com/ncss-tech/SoilDataDevelopmentToolbox/blob/master/SDA_Valu2Table.py Note: currently ignores "dense" layer restrictions
## Not run:
if (curl::has_internet()) {
var_stxt3 <- c("sandtotal_r", "claytotal_r", "silttotal_r")
x <- fetch_soils_from_NRCS_SDA(bind_params = c(471168, 1606800))
calculate_soil_depth_NRCS(
x,
restrict_by_ec_or_ph = FALSE,
var_soiltexture = var_stxt3
)
x2 <- cbind(x, organic = is_NRCS_horizon_organic(x))
calculate_soil_depth_NRCS(
x2,
restrict_by_ec_or_ph = TRUE,
var_soiltexture = var_stxt3
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.