Description Usage Arguments Value Examples
Remove connections in a network
1 | remove_connections(x, prob_remove, run_checks = TRUE, ...)
|
x |
The 'network', 'network_module', or 'matrix' object to modify. |
prob_remove |
A value between 0 and 1. Each edge will be removed with probability equal to 'prob_remove'. |
run_checks |
If TRUE and 'x' is a matrix, then it is checked that 'x' is an adjacency matrix. This catches the case where 'x' is a weighted matrix, in which case the weights are removed and a warning is given. |
... |
Additional arguments. |
The modified adjacency matrix.
1 2 3 4 5 6 7 8 9 | # Create a random network with 10 nodes.
nw <- random_network(20)
# Remove connections in the network each with probability 1/2.
nw_rewired <- remove_connections(nw, 0.5)
# Plot the two networks for comparison
g <- plot(nw)
plot(nw_rewired, g) # Pass in g to mirror the layout.
# Or plot the differential network.
plot_network_diff(nw, nw_rewired)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.