test_random_infections: Test random Infections

Description Usage Arguments Details Value Examples

Description

A function that takes takes two copies of a network, one vaccinated and one unvaccinated and test random infection in it.

Usage

1
2
test_random_infections(unvac.network, vac.network, intervention, network.size,
  infection.steps, random.samples)

Arguments

unvac.network

Network with no vaccinations

vac.network

Network with vaccinations

intervention

Vector of nodes representing vaccinated people

network.size

Number of nodes in the network.

infection.steps

Number of steps that the infection will spread.

random.samples

Vector of nodes that will be infected.

Details

For each random sample the infection will be simulated for a the specified amount of steps.

Value

List with the number of infection in the unvaccinated network [[1]] and the vaccinated network [[2]].

Examples

1
2
3
4
5
6
7
8
9
n=100
mat <- rgraph(n, mode = "graph", tprob = 0.5)
net <- network(mat, directed = FALSE)
results <- identify_vaccination_targets(igraph::betweenness,mat,n,5)
intervention <- results[[1]]
vaccinatedMat <- do.call(rbind,results[2])
vacNet <- network(vaccinatedMat, directed = FALSE)
seed <- sample.int(n,10,replace = TRUE)
results2 <- test_random_infections(net,vacNet,intervention,n,3,seed)

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