View source: R/stretchMinMax.r
stretchMinMax | R Documentation |
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.
stretchMinMax(
x,
lower = 0,
upper = 1,
nudgeUp = FALSE,
nudgeDown = FALSE,
na.rm = FALSE
)
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 |
Numeric value.
scale
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.