Normalization of vectors

Share:

Description

Normalization of vectors.

Usage

1
normalize(v, w = NULL)

Arguments

v

vector

w

optional vector

Details

The vector v is normalized to length 1. If w is given, it is normalized by the length of v.

Value

v

normalized v

w

normalized w

Author(s)

Nicole Kraemer, Mikio L. Braun

Examples

1
2
3
v<-rnorm(5)
w<-rnorm(10)
dummy<-normalize(v,w)