Description Usage Arguments Value Examples
Rewire connections to a node
1 2 |
x |
The 'network', 'network_module', or 'matrix' object to modify. |
node |
The node to rewire. |
prob_rewire |
A value between 0 and 1, inclusive. Each connection to 'node' will be rewired with probability equal to 'prob_rewire'. Note, the degree of 'node' is unchanged after this operation. |
weights |
(Optional) A vector of weights for each node. These are used in addition to the degree of each node when sampling nodes to rewire. |
alpha |
A positive value used to parameterize the Beta distribution. |
beta |
A positive value used to parameterize the Beta distribution. |
epsilon |
A small constant added to the sampling probability of each node. |
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 object.
1 2 3 4 5 6 7 8 9 | # Create a random network with 10 nodes.
nw <- random_network(10)
# Rewire connections to the first node.
nw_rewired <- rewire_connections_to_node(nw, 1)
# 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, g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.