Description Usage Arguments Value Examples
A function that infects a random individual of a network and then spreads the infection stepwise through the network return- ing a state vector of infection.
1 | infect_network(network, repetitions, network.size, random.seed = NULL)
|
network |
An undirected network object |
repetitions |
Number of steps the infection will spread |
network.size |
Number of individuals in the network |
random.seed |
A fixed seed for random infection. |
vector stating for each node whether it is "Healthy" or "Infected".
1 2 3 | n=100
net = = network(rgraph(n, mode = "graph", tprob = 0.5), directed = FALSE)
diseasedIndex <- infect_network(net,5,n)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.