Exports the current state of the network as dataframe with each node as a row and columns for node id, parent id, node type, and node level. Can also be accomplished by attr(sbm, 'state').

state(sbm)

Arguments

sbm

sbm_network object as created by new_sbm_network.

Value

A dataframe describing the current state of the network:

id

id of node

parent

id of node's parent. none if node has no parent.

type

type of node

level

level of node in network hierarchy

See also

Examples

# Small edge list to build network edges <- dplyr::tribble( ~from, ~to, "a1" , "b1" , "a1" , "b2" , "a1" , "b3" , "a2" , "b1" , "a2" , "b4" , "a3" , "b1" ) # A small simulated network with no blocks net <- new_sbm_network(edges) state(net)
#> NULL
# Add some blocks and state will reflect net %>% initialize_blocks(2) %>% state()
#> id type parent level #> 1 b1 node bl_node_0 0 #> 2 b3 node bl_node_1 0 #> 3 a1 node bl_node_0 0 #> 4 b2 node bl_node_1 0 #> 5 a3 node bl_node_0 0 #> 6 b4 node bl_node_1 0 #> 7 a2 node bl_node_0 0