Skip to contents

Function to return a list of networks, each network representing the within-block network of a block.

Usage

get_within_networks(network, block, combined_networks = TRUE)

Arguments

network

a network object

block

a vector of integers representing the block of each node

combined_networks

a boolean indicating whether the between-block networks should be returned as a combined_networks object or not (default is TRUE)

Value

a list of networks

Examples

# Load an embedded network object.
data(toyNet)
get_within_networks(toyNet, toyNet %v% "block")
#>  Combined 4 networks on ‘.NetworkID’/‘.NetworkName’:
#>   1: n = 50, directed = FALSE, bipartite = FALSE, loops = FALSE
#>   2: n = 50, directed = FALSE, bipartite = FALSE, loops = FALSE
#>   3: n = 50, directed = FALSE, bipartite = FALSE, loops = FALSE
#>   4: n = 50, directed = FALSE, bipartite = FALSE, loops = FALSE
#> 
#>  Network attributes:
#>   vertices = 200 
#>   directed = FALSE 
#>   hyper = FALSE 
#>   loops = FALSE 
#>   multiple = FALSE 
#>   bipartite = FALSE 
#>   ergm:
#>             Length Class   Mode
#> constraints 2      formula call
#>   total edges= 1165 
#>     missing edges= 0 
#>     non-missing edges= 1165 
#> 
#>  Vertex attribute names: 
#>     .NetworkID .NetworkName block vertex.names x y 
#> 
#>  Edge attribute names not shown