infect_network: Infect Network

Description Usage Arguments Value Examples

Description

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.

Usage

1
infect_network(network, repetitions, network.size, random.seed = NULL)

Arguments

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.

Value

vector stating for each node whether it is "Healthy" or "Infected".

Examples

1
2
3
n=100
net = = network(rgraph(n, mode = "graph", tprob = 0.5), directed = FALSE)
diseasedIndex <- infect_network(net,5,n)

jugdemon/isn_infection documentation built on May 20, 2019, 4:20 a.m.