Description Usage Arguments Examples
Check if an object is weighted
1 2 | ## S3 method for class 'matrix'
is_weighted(x, ...)
|
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. |
1 2 3 4 5 6 7 8 9 10 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.