plot.sir: Plots for sir objects

Description Usage Arguments Value Examples

View source: R/plot.sir.R

Description

Plot the output of S, I, R for the specified time sequence

Usage

1
2
## S3 method for class 'sir'
plot(res)

Arguments

res

data.frame of results that were generated. Element can be found using $results

Value

A plot with specified settings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Input parameters and initial stages.
parameters <- c(mu = 0.2,
                beta = 0.03, gamma = 0.5, xi = 0.05)
initials <- c(S = 0.3, I = 0.4, R = 0.3)
times <- 0:30

# Solve
sirs.birthsdeaths <- sirs_birthsdeaths(pars = parameters, init = initials, time = times)$results

#Plot
plot(sirs.birthsdeaths)

NicolasPhysentzides/popdyn documentation built on Sept. 11, 2020, 2:26 p.m.