create_network_from_modules: Create a network object.

Description Usage Arguments Value Examples

View source: R/networks.R

Description

Generates a 'network' object from a list of 'network_modules', The modules are assumed to have their local network structure already generated. Individual modules can be generated using the random_module function.

Usage

1
2
3
4
5
6
create_network_from_modules(
  p,
  module_list,
  node_names = as.character(1:p),
  ...
)

Arguments

p

The number of nodes in the graph

module_list

A named list of 'network_module' objects.

node_names

(optional) Vector of strings providing names for each node in the graph. Default names are "1", "2", ..., "p".

...

Arguments to be passed to other methods. Possible arguments include:

prob_rewire The probability of removing a connection from the local network structure; this is applied to each edge created. Used in random_module_structure.
prob_remove The probability of rewiring a connection from the local network structure; this is applied every connection of each node. See random_module_structure.
neig_size The initial degree of each node when constructing the ring lattice. See random_module_structure.
alpha A positive value used to parameterize the Beta distribution used to sample nodes based on their degree. Larger values will place more weight on highly connected nodes. See random_module_structure.
beta A positive value used to parameterize the Beta distribution used to sample nodes based on their degree. Set to 1 by default. Increasing this parameter will cause the sampling to favor moderately connected nodes over the extreme tail of highly connected nodes. See random_module_structure.
epsilon A small constant added to the sampling probability of each node. See random_module_structure.

Value

A network object.

Examples

1
2
3
4
5
6
7
8
9
# Networks can be crafted manually by first constructing the individual
# modules, then putting them together to create a network.
module_1 <- random_module(1:10) # A module containing nodes 1-10
module_2 <- random_module(5:15) # A module containing nodes 5-15
# Create a network containing 20 nodes and the two modules. 
nw <- create_network_from_modules(20, list(module_1, module_2))
nw 
# Note: nodes 16-20 are not in a module, so they have no connections.
plot(nw)

SeqNet documentation built on July 9, 2021, 9:08 a.m.