Learn R Programming

mgwrsar (version 1.3.2)

normW: Row Normalization of Sparse Matrix

Description

Row-normalizes a sparse matrix (dgCMatrix) or dense matrix so that each row sums to 1. Rows with zero sums are left unchanged.

Usage

normW(x)

Value

A row-normalized matrix of the same class as the input.

Arguments

x

A matrix or dgCMatrix class sparse matrix.