powered by
Rescales a numeric matrix or data frame globally, by row, or by column.
normalize(x, type = c("all", "row", "col"), range = c(0, 1), na.rm = TRUE)
A normalized object with the same matrix or data-frame form as x.
x
Numeric matrix or data frame.
Normalize all values together, each row, or each column.
Two increasing finite output limits.
Remove missing values when finding limits.
A constant slice is mapped to the midpoint of range.
range
m <- matrix(rnorm(20), 5, 4) normalize(m) normalize(m, type = "row", range = c(-1, 1))
Run the code above in your browser using DataLab