score_more: Score a Variable Where Higher Values Are Better

View source: R/scoring.R

score_moreR Documentation

Score a Variable Where Higher Values Are Better

Description

Applies a "more is better" linear scoring function, transforming raw variable values to a 0–1 score. This is appropriate for soil indicators where higher values improve soil function, such as organic carbon, microbial biomass, or cation exchange capacity (Andrews et al., 2004; Karlen & Stott, 1994).

The score is computed as:

S_i = \frac{x_i - x_{\min}}{x_{\max} - x_{\min}}

where x_{\min} and x_{\max} are taken from the observed data (or from user-supplied bounds).

Usage

score_more(x, x_min = NULL, x_max = NULL)

Arguments

x

Numeric vector of raw variable values.

x_min

Numeric. Lower bound for scoring. Defaults to min(x, na.rm = TRUE).

x_max

Numeric. Upper bound for scoring. Defaults to max(x, na.rm = TRUE).

Value

Numeric vector of scores in [0, 1].

References

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")}

Karlen, D.L., & Stott, D.E. (1994). A framework for evaluating physical and chemical indicators of soil quality. In J.W. Doran et al. (Eds.), Defining Soil Quality for a Sustainable Environment, pp. 53–72. SSSA Special Publication 35. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaspecpub35.c4")}

Examples

oc <- c(0.5, 1.2, 2.1, 3.4, 4.5)   # Organic Carbon (%)
score_more(oc)

# With user-defined bounds (e.g., 0 to 5%)
score_more(oc, x_min = 0, x_max = 5)


SQIpro documentation built on April 20, 2026, 5:06 p.m.