| score_all | R Documentation |
Applies the appropriate scoring function to each soil variable according
to a configuration table produced by make_config. This
is the primary data-preparation step before computing any Soil Quality
Index.
score_all(data, config, group_cols = "LandUse", custom_fns = list())
data |
A data frame containing the soil variables. |
config |
A |
group_cols |
Character vector of grouping column names to preserve
unchanged. Default is |
custom_fns |
A named list of functions for variables with
|
A data frame with the same structure as data, but with
each variable column replaced by its 0–1 score. Group columns are
preserved unchanged.
Andrews, S.S., Karlen, D.L., & Cambardella, C.A. (2004). The soil management assessment framework. Soil Science Society of America Journal, 68(6), 1945–1962. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaj2004.1945")}
data(soil_data)
cfg <- make_config(
variable = c("pH", "EC", "BD", "OC", "MBC", "Clay"),
type = c("opt", "less", "less", "more", "more", "opt"),
opt_low = c(6.0, NA, NA, NA, NA, 20),
opt_high = c(7.0, NA, NA, NA, NA, 35)
)
scored <- score_all(soil_data, cfg,
group_cols = c("LandUse", "Depth"))
head(scored)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.