Normalizes values to [0,1] range where higher values indicate better quality. Uses min-max normalization: (x - min) / (max - min).
Examples
# Higher organic matter is better
om_values <- c(1.5, 2.0, 2.5, 3.0, 3.5)
score_higher_better(om_values)
#> [1] 0.00 0.25 0.50 0.75 1.00
# With custom min/max
score_higher_better(om_values, min_val = 1, max_val = 4)
#> [1] 0.1666667 0.3333333 0.5000000 0.6666667 0.8333333
