Description Usage Arguments Value Examples
The small-world network is generated using the Watts-Strogatz method. See ?igraph::watts.strogatz.game for details.
1 2 | update_module_with_random_weights(module, rdist = function(n) {
runif(n, 0.5, 1) * (-1)^rbinom(n, 1, 0.5) }, ...)
|
module |
The network_module object to modify. |
rdist |
A distribution function that generates random numbers. The first argument should specify the number of weights to generate. By default, weights are generated uniformly from the set (-1, -0.5)U(0.5, 1). |
... |
Additional parameters are ignored. |
An updated 'network_module' object.
1 2 3 4 5 6 | # Create a random module.
module <- random_module(1:10)
is_weighted(module)
# Add a random weight to each connection.
module <- update_module_with_random_weights(module)
is_weighted(module)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.