| score_less | R Documentation |
Applies a "less is better" linear scoring function, transforming raw variable values to a 0–1 score. Suitable for soil indicators where lower values denote better soil quality, such as bulk density, electrical conductivity, or heavy metal concentrations (Andrews et al., 2004).
The score is computed as:
S_i = \frac{x_{\max} - x_i}{x_{\max} - x_{\min}}
score_less(x, x_min = NULL, x_max = NULL)
x |
Numeric vector of raw variable values. |
x_min |
Numeric. Lower bound. Defaults to |
x_max |
Numeric. Upper bound. Defaults to |
Numeric vector of scores in [0, 1].
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")}
bd <- c(0.9, 1.1, 1.3, 1.5, 1.7) # Bulk Density (g/cm3)
score_less(bd)
# With domain bounds
score_less(bd, x_min = 0.8, x_max = 2.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.