View source: R/generic_utilities.R
rangeRescale | R Documentation |
rangeRescale this function rescales a numeric vector to a new range through linear interpolation
rangeRescale(
x,
newMin,
newMax,
oldMin = min(x, na.rm = T),
oldMax = max(x, na.rm = T),
pres.signs = FALSE
)
x |
|
newMin , newMax |
Any two points (typically min and max) of the new scale |
oldMin , oldMax |
The corresponding two points of the original scale. If oldMin or oldMax are missing the min or max of x are used instead |
pres.sign |
logical. if TRUE the signs of the original data are preserved. newMin and newMax must be opposites (e.g. -1,1) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.