range01: Scale Object Values Between Zero and One

Description Usage Arguments Value Author(s) Examples

View source: R/range01.r

Description

Force the minimum value and maximum value of an object to 0 and 1, respectively.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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

imagefx documentation built on Feb. 14, 2020, 1:07 a.m.