compare_infections: Compare Infections

Description Usage Arguments Value Examples

Description

A function that takes takes two copies of a network, one vaccinated and one unvaccinated

Usage

1
2
compare_infections(unvac.network, vac.network, intervention, infection.steps,
  random.seed)

Arguments

unvac.network

Network with no vaccinations

vac.network

Network with vaccinations

intervention

Vector of nodes representing vaccinated people

infection.steps

Number of steps that the infection will spread.

Value

List with the graph representation of the unvaccinated network [[1]], the vaccinated network [[2]], the infected index under no vaccination [[3]], and the infected index under vaccination [[4]].

Examples

1
2
3
4
5
6
7
8
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)
results2 <- compare_infections(net,vacNet,intervention,3)

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