as_single_module {SeqNet}R Documentation

Collapses all modules in network into a single module

Description

This modification can be used if it is desired to simulate from a single GGM rather than averaging over the GGMs for each module.

Usage

as_single_module(network)

Arguments

network

The 'network' object to modify

Value

The modified 'network' object.

Examples

# This function can be used prior to generating weights for the network 
# connections. With multiple modules in the network, the weighted network may
# gain conditional dependencies between nodes across modules. If the network
# is reduced to a single module prior to generating weights, then the
# weighted and unweighted networks will maintain the same structure.
nw <- random_network(20, n_modules = 3)
g <- plot(nw)
nw <- gen_partial_correlations(nw)
plot(nw, g) # Additional edges appear from conditional dependencies across modules.
nw <- remove_weights(nw) # Remove weights to avoid warning message in next call.
nw <- as_single_module(nw)
nw <- gen_partial_correlations(nw)
plot(nw, g) # With only one module, the weighted network has the same structure.

[Package SeqNet version 1.1.3 Index]