Learn R Programming

cooltools (version 2.4)

unitvector: Normalize vectors to unit length

Description

Compute the unit vectors for for a matrix of non-normalised vectors

Usage

unitvector(x)

Value

Returns a data type identical to x, but with normalised vectors. Zero-vectors are returned for vectors of length zero.

Arguments

x

m-element vector or n-by-m matrix x[1:n,1:m] representing n m-element vectors

Author

Danail Obreschkow

See Also

vectornorm