R: Normalize vectors to norm 1

normalize {compositions} | R Documentation

## Normalize vectors to norm 1

### Description

Normalize vectors to norm 1.

### Usage

    normalize(x,...)
    ## Default S3 method:
    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.

### Author(s)

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

### See Also

`norm.rmult`

### Examples

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

[Package compositions version 1.40-3 Index]