R/l1NormalizeRows.R

Defines functions l1NormalizeRows

Documented in l1NormalizeRows

#' Row-normalize a sparse, symmetric matrix (using the l1 norm) so that each
#' row sums to 1.
#'
#' @param A matrix
#' @usage l1NormalizeRows(A)
#' @return row-normalized sparse matrix object
#' @keywords internal
l1NormalizeRows <- function(A) {
    return(A/Matrix::rowSums(A))
}

Try the netSmooth package in your browser

Any scripts or data that you put into this service are public.

netSmooth documentation built on Nov. 8, 2020, 5:33 p.m.