vect.normalize: Normalizes the given vector by dividing each element by the...

View source: R/linalg.R

vect.normalizeR Documentation

Normalizes the given vector by dividing each element by the vector magnitude

Description

Normalizes the given vector by dividing each element by the vector magnitude

Usage

vect.normalize(v, cent = FALSE)

Arguments

v

a vector of numerics to be normalized

cent

A logical. Should the vector be also centralized?

Value

A numeric vector containing the normalized values. Sum of squares of elements of the output vector will be 1.0.

Examples

vect.normalize(c(3, 4))
[1] 0.6 0.8


genpack/gener documentation built on March 14, 2023, 9:52 a.m.