is_weighted {SeqNet}R Documentation

Check if an object is weighted

Description

Check if an object is weighted

Usage

is_weighted(x, ...)

Arguments

x

Either a 'network', 'network_module', or 'matrix' object.

...

Additional arguments. object are weighted by 0s and 1s, and returns TRUE otherwise. If there are no connections in the module, then this function returns TRUE.

Value

A Boolean value indicating whether the input is weighted.

Examples

# Create a random network with 10 nodes. 
nw <- random_network(10)
# The network, and hence all of its modules, are unweighted.
is_weighted(nw)
sapply(nw$modules, is_weighted)
# Add random weights to the connections.
nw <- gen_partial_correlations(nw)
# The network, and hence all of its modules, are now weighted.
is_weighted(nw)
sapply(nw$modules, is_weighted)

[Package SeqNet version 1.1.3 Index]