Learn R Programming

compositions (version 2.0-4)

normalize: Normalize vectors to norm 1

Description

Normalize vectors to norm 1.

Usage

normalize(x,...)
# S3 method for default
normalize(x,...)

Value

The vectors given, but normalized to norm 1.

Arguments

x

a dataset or a single vector of some type

...

currently not used, intended to select a different norm in the future

Author

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

See Also

norm.rmult

Examples

Run this code
data(SimulatedAmounts)
normalize(c(1,2,3))
normalize(acomp(c(1,2,3)))
norm(normalize(acomp(sa.groups)))

Run the code above in your browser using DataLab