For 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)

Arguments

sbm

sbm_network object as created by new_sbm_network.

node_id

String identifying the node that edge counts are desired for

connection_level

Level of blocks to get connections to. E.g. 1 = node block level, 0 = connections to other nodes.

Value

Dataframe with two columns: id for the id of the node/block connected to, and count for the number of connections between.

See also

Examples

# 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