Learn R Programming

wordspace (version 0.2-0)

normalize.rows: Normalize Rows or Columns of Matrix to Unit Length (wordspace)

Description

Efficiently normalize the row or column vectors of a dense or sparse matrix to unit length.

Usage

normalize.rows(M, …)

normalize.cols(M, …)

Arguments

M

a dense or sparse numeric matrix

optional method and p arguments are passed to rowNorms (or colNorms)

Value

A row-normalized (or column-normalized) matrix with the same dimensions as \(M\).

Details

Note that the generalized Minkowski length measure for \(p < 1\) cannot be normalized with normalize.rows because it doesn't satisfy the homogeneity axiom. The Hamming length obtained for \(p = 0\) cannot be normalized at all. See rowNorms for more information.

See Also

See rowNorms for details on available norms and their parameters.