normalize_to_range {usefun} | R Documentation |
Range normalization
Description
Normalize a vector, matrix or data.frame of numeric values in a specified range.
Usage
normalize_to_range(x, range = c(0, 1))
Arguments
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) |
Value
the normalized data
Examples
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))
[Package usefun version 0.5.0 Index]