make_reduced_from_partition | R Documentation |
Takes an adjacency matrix and a partition of the nodes, and returns a reduced adjacency matrix and the corresponding cutoff density/degree. The sna package must be installed, but does not need to be attached.
make_reduced_from_partition(adj_mat, partition, stat = 'density')
adj_mat |
A adjacency matrix |
partition |
A vector that gives the desired partitioning of the nodes. This must be an integer vector with all values between 1 and |
stat |
The statistic that will be used to determine if edges should be included in a reduced network. Default value is |
A reduced network represents each identified position in the network as a single node. Links (or self-links) exist if the density (or normalized degree) of ties from that block to a target block is greater than a threshold density (or degree). In the default implementation, the density of the whole network is used as the threshold for each block. In the degree implementation, the normalized degree of the network is used as the threshhold.
reduced_mat |
A reduced matrix |
dens |
The cut-off density used (equal to the edge density of |
deg |
The cut-off normalized outdegree used (equal to the mean outdegree of |
S. Wasserman and K. Faust, Social Network Analysis: Methods and Applications (Cambridge University Press, 1994).
make_reduced
, make_blk
## Generate a random network (with reproducibility)
set.seed(1234)
g <- igraph::erdos.renyi.game(50,p=0.2)
g_adj <- as.matrix(igraph::as_adjacency_matrix(g))
ebc.g <- igraph::edge.betweenness.community(g)
ebPart <- ebc.g$membership
## Generate reduced network using degree statistic
g.red <- make_reduced_from_partition(g_adj, ebPart, stat='degree')
plot_reduced(make_reduced_igraph(g.red$reduced_mat))
## Generate reduced network using density statistic
g.red.den <- make_reduced_from_partition(g_adj, ebPart, stat='density')
plot_reduced(make_reduced_igraph(g.red.den$reduced_mat))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.