powered by
Normalize a vector, matrix or data.frame of numeric values in a specified range.
normalize_to_range(x, range = c(0, 1))
the normalized data
vector, matrix or data.frame with at least two different elements
vector of two elements specifying the desired normalized range. Default value is c(0,1)
vec = 1:10 normalize_to_range(vec) normalize_to_range(vec, range = c(-1,1)) mat = matrix(c(0,2,1), ncol = 3, nrow = 4) normalize_to_range(mat, range = c(-5,5))
Run the code above in your browser using DataLab