range01 {imagefx} | R Documentation |
Scale Object Values Between Zero and One
Description
Force the minimum value and maximum value of an object to 0 and 1, respectively.
Usage
range01(x)
Arguments
x |
Matrix, vector, or other R object. |
Value
An object with same dimensions as x
and whose values range between zero and one.
Author(s)
Alex J.C. Witsil
Examples
## 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
[Package imagefx version 0.4.1 Index]