# NOT RUN {
## Create an 'SIR' model with 5 nodes and initialize
## it to run over 10 days.
u0 <- data.frame(S = rep(99, 5), I = rep(1, 5), R = rep(0, 5))
model <- SIR(u0 = u0, tspan = 1:10, beta = 0.16, gamma = 0.077)
## Run the model and save the result
result <- run(model, threads = 1, seed = 1)
## Extract the number of recovered individuals in each
## node after each time step in the simulation
recovered(result)
## Extract the number of recovered individuals in the
## first node after each time step in the simulation
recovered(result, i = 1)
## Extract the number of recovered individuals in the
## first and third node after each time step in the simulation
recovered(result, i = c(1, 3))
# }
Run the code above in your browser using DataLab