range01 {imagefx} | R Documentation |
Force the minimum value and maximum value of an object to 0 and 1, respectively.
range01(x)
x |
Matrix, vector, or other R object. |
An object with same dimensions as x
and whose values range between zero and one.
Alex J.C. Witsil
## generate a signal to normalize
sig <- 10*sin(2*pi*5*seq(0,1,by=0.001))
## normalize between 0 and 1
sig01 <- range01(sig)
## check the ranges
range(sig)
##[1] -10 10
range(sig01)
##[1] 0 1