Description Usage Arguments Value Examples
Standard: Rescale values to a standard normal scale
Normal: Rescale values to a standard (0-1) scale
Log: Rescale values to a natural log scale
Point-scale: Rescale values to a new point scale
1 2 3 4 5 6 7 8 | rescale_standard(x, na_omit = TRUE)
rescale_normal(x, na_omit = TRUE)
rescale_log(x, na_omit = TRUE)
rescale_pointscale(x, lower, upper, lower0 = NULL, upper0 = NULL,
na_omit = TRUE)
|
x |
Input vector |
na_omit |
Logical indicating whether to drop missing (NA) values. Default is TRUE. |
lower |
Min value of new scale. Only applicable for pointscales. |
upper |
Max value of new scale. Only applicable for pointscales. |
lower0 |
Min value of old scale. If NULL, defaults to min of input. Only applicable for pointscales. |
upper0 |
Max value of old scale. If NULL, defaults to max of input Only applicable for pointscales. |
Rescaled vector
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## randomly sample 10 values ranging from -10 to 100
x <- sample(-10:100, 10)
## rescale to 0-1 scale
rescale_standard(x)
## rescale to normal distribution (z-scores)
rescale_normal(x)
## rescale to logged distribution (natural log)
rescale_log(x)
## rescale to new point scale
rescale_pointscale(x, 1, 7, lower0 = -10, upper0 = 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.