rewire_connections_to_node.matrix {SeqNet} | R Documentation |
Rewire connections to a node
Description
Rewire connections to a node
Usage
## S3 method for class 'matrix'
rewire_connections_to_node(
x,
node,
prob_rewire = 1,
weights = NULL,
alpha = 100,
beta = 1,
epsilon = 10^-5,
run_checks = TRUE,
...
)
Arguments
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
|
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 |
... |
Additional arguments. |
Value
The modified object.
Examples
# 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)