normalize_to_range | R Documentation |
Normalize a vector, matrix or data.frame of numeric values in a specified range.
normalize_to_range(x, range = c(0, 1))
x |
vector, matrix or data.frame with at least two different elements |
range |
vector of two elements specifying the desired normalized range. Default value is c(0,1) |
the normalized data
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.