Sparsify.matrix.fixed.neighbours-methods | R Documentation |
Methods to sparsify a network matrix by fixing the number of edges for each node. It selects the first k neighbours for each node (by row) according to the weight of the edge By this function you select exactly k edges for each node (if there are at least k edges in the adjacency matrix). The resulting matrix is not symmetric.
Sparsify.matrix.fixed.neighbours(W, k=10)
W |
an object representing the graph to be normalized |
k |
the number of edges for each node (def.=10) |
a sparsified matrix (Warning: the matrix is not symmetric)
signature(W = "graph")
an object of the virtual class graph (hence including objects of class graphAM
and graphNEL
from the package graph)
signature(W = "matrix")
a matrix representing the adjacency matrix of the graph
library(bionetdata); data(FIN.data); W <- Laplacian.norm(as.matrix(FIN.data)); # sparsification with 10 neighbours per node W10 <- Sparsify.matrix.fixed.neighbours(W); # sparsification with 20 neighbours per node W20 <- Sparsify.matrix.fixed.neighbours(W, k=20);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.