Rescale a numeric variable
Rescale a numeric variable to a new range.
change_scale(x, ...) ## S3 method for class 'numeric' change_scale(x, to = c(0, 100), range = NULL, verbose = TRUE, ...) ## S3 method for class 'grouped_df' change_scale( x, select = NULL, exclude = NULL, to = c(0, 100), range = NULL, ... ) ## S3 method for class 'data.frame' change_scale( x, select = NULL, exclude = NULL, to = c(0, 100), range = NULL, ... )
x |
Object. |
... |
Arguments passed to or from other methods. |
to |
New range of values of the data after rescaling. |
range |
Initial (old) range of values. If |
verbose |
Toggle warnings and messages on or off. |
select |
Character vector of column names. If |
exclude |
Character vector of column names to be excluded from selection. |
A rescaled object.
Other transform utilities:
normalize()
,
ranktransform()
,
standardize()
change_scale(c(0, 1, 5, -5, -2)) change_scale(c(0, 1, 5, -5, -2), to = c(-5, 5)) head(change_scale(trees))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.