| sqi_linear | R Documentation |
Computes the Soil Quality Index (SQI) using the linear additive scoring
method of Doran & Parkin (1994) and Andrews et al. (2004). Each variable
score (0–1, from score_all) is averaged across replicates
within each group, optionally weighted, and then min-max normalised to
produce the final index.
SQI_g = \frac{\sum_{j=1}^{p} w_j \bar{S}_{gj}}{\sum_{j=1}^{p} w_j}
where \bar{S}_{gj} is the mean score of variable j in group
g and w_j is the weight of variable j.
sqi_linear(
scored,
config,
group_cols = "LandUse",
mds_vars = NULL,
weights = NULL
)
scored |
A scored data frame from |
config |
A |
group_cols |
Character vector of grouping column names. |
mds_vars |
Character vector. If supplied, only these variables are
used. Otherwise all numeric variables in |
weights |
Named numeric vector of variable weights. Defaults to equal weights (1 for all). Names must match variable names. |
A data frame with group columns plus:
Final normalised Soil Quality Index (0–1).
Weighted mean score before normalisation.
Doran, J.W., & Parkin, T.B. (1994). Defining and assessing soil quality. In J.W. Doran et al. (Eds.), Defining Soil Quality for a Sustainable Environment, pp. 1–21. SSSA Special Publication 35. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaspecpub35.c1")}
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"))
result <- sqi_linear(scored, cfg, group_cols = c("LandUse","Depth"))
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.