View source: R/extra_functions.R
node_sparsity | R Documentation |
Calculates the node sparsity of a vectorized adjacency matrix, defined as the average number of nodes with no edges.
node_sparsity(beta, type = c("undirected", "directed"))
beta |
Vectorized adjacency matrix. |
type |
Specifies whether the vector represents an |
Percentage of inactive nodes in the graph
A <- matrix(0, ncol = 4, nrow = 4) A[2, 1] <- 1 A[1, 2] <- 1 A[2, 3] <- 1 A[3, 2] <- 1 vec <- matrix_to_vec(A) node_sparsity(vec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.