norm_colsum {crosstalkr} | R Documentation |
Function to normalize adjacency matrix by dividing each value by the colsum.
Description
Function to normalize adjacency matrix by dividing each value by the colsum.
Usage
norm_colsum(w)
Arguments
w |
The adjacency matrix of a given graph in sparse format - dgCMatrix |
Value
input matrix, normalized by column sums
Examples
# 1) Normalize by column sum on a simple matrix
v1 = (c(1,1,1,0))
v2 = c(0,0,0,1)
v3 = c(1,1,1,0)
v4 = c(0,0,0,1)
w = matrix(data = c(v1,v2,v3,v4), ncol = 4, nrow = 4)
norm_colsum(w)
[Package crosstalkr version 1.0.5 Index]