remove_connections.matrix {SeqNet} | R Documentation |
Remove connections in a network
Description
Remove connections in a network
Usage
## S3 method for class 'matrix'
remove_connections(x, prob_remove, run_checks = TRUE, ...)
Arguments
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 |
run_checks |
If |
... |
Additional arguments. |
Value
The modified adjacency matrix.
Examples
# 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)
[Package SeqNet version 1.1.3 Index]