Learn R Programming

compositions (version 2.0-0)

normalize: Normalize vectors to norm 1

Description

Normalize vectors to norm 1.

Usage

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

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
# NOT RUN {
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