R/model__node_to_block_edge_counts.R
node_to_block_edge_counts.RdFor a given node in an SBM, returns a dataframe of each block (or node) that the desired node is connected to and how many connections they have to that block.
node_to_block_edge_counts(sbm, node_id, connection_level = 1L)
| sbm |
|
|---|---|
| node_id | String identifying the node that edge counts are desired for |
| connection_level | Level of blocks to get connections to. E.g. |
Dataframe with two columns: id for the id of the node/block connected to, and count for the number of connections between.
Other advanced:
add_edge(),
add_node(),
initialize_blocks(),
update_state()
# A small simulated network with random block assignment net <- sim_basic_block_network(n_blocks = 3, n_nodes_per_block = 10) %>% initialize_blocks(3) # Get a random node's edge counts to blocks node_id <- sample(net$nodes$id, 1) net %>% node_to_block_edge_counts(node_id, connection_level = 1)#> block n_edges #> 1 bl_node_1 3 #> 2 bl_node_0 5 #> 3 bl_node_2 6