stretchMinMax {omnibus} | R Documentation |
Rescale values
Description
This function rescales a vector of numeric values to an arbitrary range. Optionally, after the stretch values equal to the lowest value can be "nudged" slightly higher to half the minimum value across the rescaled vector of values > 0.
Usage
stretchMinMax(
x,
lower = 0,
upper = 1,
nudgeUp = FALSE,
nudgeDown = FALSE,
na.rm = FALSE
)
Arguments
x |
Numeric list. |
lower |
Numeric, low end of range to which to stretch. |
upper |
Numeric, high end of range to which to stretch. |
nudgeUp , nudgeDown |
Logical, if |
na.rm |
Logical, if |
Value
Numeric value.
See Also
Examples
x <- 1:10
stretchMinMax(x)
stretchMinMax(x, lower=2, upper=5)
stretchMinMax(x, nudgeUp=TRUE)
stretchMinMax(x, lower=2, upper=5, nudgeUp=TRUE)
stretchMinMax(x, nudgeDown=TRUE)
stretchMinMax(x, lower=2, upper=5, nudgeUp=TRUE, nudgeDown=TRUE)
x <- c(1:5, NA)
stretchMinMax(x)
stretchMinMax(x, na.rm=TRUE)
[Package omnibus version 1.2.13 Index]