Scoring functions

score.rescale(x, xlim = NULL, method = "linear", ...)

Arguments

x

A numeric vector of data.

xlim

The scoring range. If null, derives range from data.

method

Only 'linear' is supported.

...

Arguments for min, max, pmin, pmax.

p

A percentage buffer to add to the maximum value.

Value

Returns scores.

See also

min, max, pmin, pmax

Examples

score.max(c(0.5, 1, 2))
#> [1] 0.25 0.50 1.00
score.max(c(0.5, 1, 2), p=0.25)
#> [1] 0.2 0.4 0.8
score.rescale(c(0.5, 1, 2))
#> [1] 0.0000000 0.3333333 1.0000000
score.clamp(c(-0.5, 1, 2))
#> [1] 0 1 1
score.clamp(c(-0.5, 1, 2), xlim=c(-1, 1))
#> [1] -0.5 1.0 1.0