Learn R Programming

compositions (version 1.01-1)

normalize: Normalize vectors to norm 1

Description

Normalize vectors to norm 1.

Usage

normalize(x,...)
## S3 method for class 'default':
normalize(x,\dots)

Arguments

x
a dataset or a single vector of some type
...
currently not used, intended to select a different norm in the future

Value

  • The vectors given, but normalized to norm 1.

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