rescale_mid | R Documentation |
Rescale vector to have specified minimum, midpoint, and maximum
rescale_mid(x, to, from, mid, ...)
## S3 method for class 'numeric'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...)
## S3 method for class 'logical'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...)
## S3 method for class 'dist'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...)
## S3 method for class 'POSIXt'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...)
## S3 method for class 'Date'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...)
## S3 method for class 'integer64'
rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...)
## S3 method for class 'AsIs'
rescale_mid(x, to, from, ...)
x |
vector of values to manipulate. |
to |
output range (numeric vector of length two) |
from |
input range (vector of length two). If not given, is
calculated from the range of |
mid |
mid-point of input range |
... |
other arguments passed on to methods |
Objects of class <AsIs>
are returned unaltered.
rescale_mid(1:100, mid = 50.5)
rescale_mid(runif(50), mid = 0.5)
rescale_mid(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.