Returns the number of blocks/clusters in the current model state.

n_blocks(sbm)

Arguments

sbm

Object of class sbm_network.

Value

Number of clusters in current model state

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) n_blocks(net)
#> [1] 0
# Add some two random blocks net %>% initialize_blocks(2) %>% n_blocks()
#> [1] 2
# Add a block per node net %>% initialize_blocks() %>% n_blocks()
#> [1] 2