Learn R Programming

compositions (version 1.01-1)

norm: Vector space norm

Description

Each of the considered space structures has an associated norm, which is computed for each element by these functions.

Usage

## S3 method for class 'default':
norm(X,\dots)
## S3 method for class 'acomp':
norm(X,\dots)
## S3 method for class 'rcomp':
norm(X,\dots)
## S3 method for class 'aplus':
norm(X,\dots)
## S3 method for class 'rplus':
norm(X,\dots)
## S3 method for class 'rmult':
norm(X,\dots)

Arguments

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

Value

  • The norms of the given vectors.

See Also

normalize

Examples

Run this code
data(SimulatedAmounts)
tmp <- acomp(sa.lognormals)
mvar(tmp)
sum(norm( tmp - mean(tmp) )^2)/(nrow(tmp)-1)

Run the code above in your browser using DataLab