Description Usage Arguments Value
View source: R/transform_variables.R
rescale_variable rescales a variable from an old range of values (min_old to max_old) to a new range (min_new to max_new). Default behavior is to rescale a variable to a new range from 0 to 1 where the minimum observed value is recoded to 0 and the maximum observed value is recoded to 1.
1 | rescale_variable(x, min_old, min_new = 0, max_old, max_new = 1)
|
x |
A numeric variable. |
min_old |
The old minimum value for the variable. Default is the variable's minimum value. |
min_new |
The new minimum value, defaults to 0. |
max_old |
The old maximum value for the variable. Default is the variable's maximum value. |
max_new |
The new maximum value, defaults to 1. |
The rescaled variable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.