Learn R Programming

swfscMisc (version 1.2)

normalize: Normalize a Numeric Vector

Description

Normalize a numeric vector to have a mean of zero and a standard deviation of one.\

Usage

normalize(x)

Arguments

x

a numeric vector.

Value

a numeric vector of the same length as x.

Examples

Run this code
# NOT RUN {
x <- runif(20, 50, 110)
x.norm <- normalize(x)
mean(x)
mean(x.norm)
sd(x)
sd(x.norm)

# }

Run the code above in your browser using DataLab