random_network: Create a network object.

Description Usage Arguments Value Examples

View source: R/networks.R

Description

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

Usage

1
2
random_network(p, n_modules = NULL, consistent_connections = FALSE,
  ...)

Arguments

p

The number of nodes in the network; 'p' is required to be between 10 and 20000.

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.

consistent_connections

If TRUE, then each module is modified so that, if two genes are connected in one module, then they are connected in every module.

...

Additional arguments passed to 'create_modules_for_network()', which uses 'sample_link_nodes_fn()', 'sample_module_nodes_fn()', and 'random_module()'.

Value

An unweighted network object.

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)

tgrimes/SeqNet documentation built on Sept. 1, 2020, 7:50 a.m.