Takes data from sbm_network object and checks S4 SBM class model object exists and is usable. If it isn't it is created.

verify_model(sbm, show_messages = FALSE, warn_about_random_seed = TRUE)

Arguments

sbm

Object of class sbm_network.

show_messages

Should function inform of its actions such as when a model already exists so no changes are made?

warn_about_random_seed

Should the model warn about cases when set seed is present for cached model?

Value

An S3 object of class sbm_network. For details see new_sbm_network section "Class structure."

See also

Examples

# Setup network without model initialized net <- sim_basic_block_network(n_blocks = 3, n_nodes_per_block = 20, setup_model = FALSE) net
#> SBM Network with 60 nodes of a single type and 784 edges. #> #> Nodes: # A tibble: 6 x 3 #> id block type #> <chr> <chr> <chr> #> 1 g1_1 g1 node #> 2 g1_2 g1 node #> 3 g1_3 g1 node #> 4 g1_4 g1 node #> 5 g1_5 g1 node #> 6 g1_6 g1 node #> ... #> #> Edges: # A tibble: 6 x 2 #> from to #> <chr> <chr> #> 1 g1_1 g1_2 #> 2 g1_1 g1_3 #> 3 g1_1 g1_4 #> 4 g1_1 g1_5 #> 5 g1_1 g1_6 #> 6 g1_1 g1_7 #> ... #>
# Run verify model and the model should now be initialized net <- net %>% verify_model() net
#> SBM Network with 60 nodes of a single type and 784 edges. #> #> Nodes: # A tibble: 6 x 3 #> id block type #> <chr> <chr> <chr> #> 1 g1_1 g1 node #> 2 g1_2 g1 node #> 3 g1_3 g1 node #> 4 g1_4 g1 node #> 5 g1_5 g1 node #> 6 g1_6 g1 node #> ... #> #> Edges: # A tibble: 6 x 2 #> from to #> <chr> <chr> #> 1 g1_1 g1_2 #> 2 g1_1 g1_3 #> 3 g1_1 g1_4 #> 4 g1_1 g1_5 #> 5 g1_1 g1_6 #> 6 g1_1 g1_7 #> ... #>