random_network: Create a network object.

Description Usage Arguments Value References Examples

View source: R/networks.R

Description

Creates an unweighted 'network' object containing randomly generated modules.

Usage

1
random_network(p, n_modules = NULL, ...)

Arguments

p

The number of nodes in the network. If p is much larger than 10^4, computation may begin to slow depending on the average module size and the amount of overlap among modules.

n_modules

The number of modules to include in the network. If NULL, then modules are created until all nodes in the network have positive degree.

...

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

nu A value between 0 and 1 used to control the amount of overlap among modules. Smaller values result in less overlap. Used in sample_module_nodes.
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.
avg_module_size See create_modules_for_network.
sd_module_size See create_modules_for_network.
min_module_size See create_modules_for_network.
max_module_size See create_modules_for_network.

Value

An unweighted network object.

References

\insertRef

grimes21SeqNet

Examples

1
2
3
4
5
6
7
# Create a random network of 10 nodes
nw <- random_network(10)
nw
# Add a random weight to each connection.
nw <- gen_partial_correlations(nw)
# Plot the network
plot(nw)

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