| make_config | R Documentation |
Constructs a variable configuration data frame that specifies the scoring function type and relevant parameters for each soil indicator. This configuration table is the central object passed to all scoring and indexing functions in SQIpro.
make_config(
variable,
type,
opt_low = rep(NA_real_, length(variable)),
opt_high = rep(NA_real_, length(variable)),
min_val = rep(NA_real_, length(variable)),
max_val = rep(NA_real_, length(variable)),
weight = rep(1, length(variable)),
description = rep(NA_character_, length(variable))
)
variable |
Character vector of variable names (must match column names in the data). |
type |
Character vector of scoring types, one per variable. Must be one of:
|
opt_low |
Numeric vector. Lower bound of optimum range (required for
|
opt_high |
Numeric vector. Upper bound of optimum range (required for
|
min_val |
Numeric vector. Absolute minimum value (required for
|
max_val |
Numeric vector. Absolute maximum value (required for
|
weight |
Numeric vector of user-defined weights (0–1). Used only
when |
description |
Character vector. Optional human-readable description of each variable (units, rationale). Useful for automated reports. |
A data frame (class sqi_config) with one row per variable.
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")}
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),
description = c("Soil pH (H2O)",
"Electrical Conductivity (dS/m)",
"Bulk Density (g/cm3)",
"Organic Carbon (%)",
"Microbial Biomass Carbon (mg/kg)",
"Clay content (%)")
)
print(cfg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.