norm_vecs: Normalize (a matrix of) vectors

View source: R/SparseVFC.R

norm_vecsR Documentation

Normalize (a matrix of) vectors

Description

Normalize the data so that the mean of the vectors is 0 and the variance of the vectors is 1. Here the variance of vectors is calculated by interpreting the deviation as the Euclidean distance, which means the trace of the (population) covariance matrix is 1.

Usage

norm_vecs(x)

Arguments

x

The matrix to be normalized. Each row of x represent a vector.

Value

The normalized matrix with two attributions scale and mean, which are used for normalization.

Examples

norm_vecs(matrix(seq(1, 100), ncol = 2))

SparseVFC documentation built on Nov. 10, 2023, 1:17 a.m.