R/l1NormalizeColumns.R

Defines functions l1NormalizeColumns

Documented in l1NormalizeColumns

#' Column-normalize a sparse, symmetric matrix (using the l1 norm) so that each
#' column sums to 1.
#'
#' @param A matrix
#' @usage l1NormalizeColumns(A)
#' @return column-normalized sparse matrix object
#' @keywords internal
l1NormalizeColumns <- function(A) {
    return(Matrix::t(Matrix::t(A)/Matrix::colSums(A)))
}
BIMSBbioinfo/netSmooth documentation built on Dec. 24, 2019, 8:08 p.m.