stretch {cooltools} | R Documentation |
Stretch values to a custom range
Description
Shifts and stretches the values of a vector or array to a desired interval, while maintaining the shape of the input argument
Usage
stretch(x, min = 0, max = 1, invert = FALSE, gamma = NULL, na = NULL)
Arguments
x |
vector or array |
min |
minimum value |
max |
maximum value |
invert |
logical flag specifying whether the data should be inverted, such that the smallest input value maps to max and the largest input value maps to min. |
gamma |
optional argument specifying a non-linear transformation x->x^gamma, if gamma>0, or x->1-(1-x)^(-gamma), if gamma<0. |
na |
optional value specifying the value assigned to non-numbers (NA and NaN) |
Value
vector/array of the same shape as x
Author(s)
Danail Obreschkow
See Also
lim
[Package cooltools version 2.4 Index]