R/get_node_to_block_edge_counts.R
get_node_to_block_edge_counts.Rd
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.
get_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()
,
set_node_parent()
,
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 %>% get_node_to_block_edge_counts(node_id, connection_level = 1)#> id count #> 1 node-1_0 7 #> 2 node-1_1 7 #> 3 node-1_2 5