Normalize numeric variable to [0-1] range
Performs a normalization of data, i.e., it scales variables in the range 0 -
This is a special case of change_scale()
.
normalize(x, ...) ## S3 method for class 'numeric' normalize(x, include_bounds = TRUE, verbose = TRUE, ...) ## S3 method for class 'grouped_df' normalize( x, select = NULL, exclude = NULL, include_bounds = TRUE, verbose = TRUE, ... ) ## S3 method for class 'data.frame' normalize( x, select = NULL, exclude = NULL, include_bounds = TRUE, verbose = TRUE, ... )
x |
A numeric vector, data frame, or matrix. See details. |
... |
Arguments passed to or from other methods. |
include_bounds |
Logical, 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. |
If x
is a matrix, normalization is performed across all values (not
column- or row-wise). For column-wise normalization, convert the matrix to a
data.frame.
If x
is a grouped data frame (grouped_df
), normalization is performed
separately for each group.
A normalized object.
Smithson M, Verkuilen J (2006). A Better Lemon Squeezer? Maximum-Likelihood Regression with Beta-Distributed Dependent Variables. Psychological Methods, 11(1), 54–71.
Other transform utilities:
change_scale()
,
ranktransform()
,
standardize()
normalize(c(0, 1, 5, -5, -2)) normalize(c(0, 1, 5, -5, -2), include_bounds = FALSE) head(normalize(trees))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.