File: plot.sir.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (96 lines) | stat: -rw-r--r-- 2,501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/epi.R
\name{plot.sir}
\alias{plot.sir}
\title{Plotting the results on multiple SIR model runs}
\usage{
\method{plot}{sir}(
  x,
  comp = c("NI", "NS", "NR"),
  median = TRUE,
  quantiles = c(0.1, 0.9),
  color = NULL,
  median_color = NULL,
  quantile_color = NULL,
  lwd.median = 2,
  lwd.quantile = 2,
  lty.quantile = 3,
  xlim = NULL,
  ylim = NULL,
  xlab = "Time",
  ylab = NULL,
  ...
)
}
\arguments{
\item{x}{The output of the SIR simulation, coming from the \code{\link[=sir]{sir()}}
function.}

\item{comp}{Character scalar, which component to plot. Either \sQuote{NI}
(infected, default), \sQuote{NS} (susceptible) or \sQuote{NR} (recovered).}

\item{median}{Logical scalar, whether to plot the (binned) median.}

\item{quantiles}{A vector of (binned) quantiles to plot.}

\item{color}{Color of the individual simulation curves.}

\item{median_color}{Color of the median curve.}

\item{quantile_color}{Color(s) of the quantile curves. (It is recycled if
needed and non-needed entries are ignored if too long.)}

\item{lwd.median}{Line width of the median.}

\item{lwd.quantile}{Line width of the quantile curves.}

\item{lty.quantile}{Line type of the quantile curves.}

\item{xlim}{The x limits, a two-element numeric vector. If \code{NULL}, then
it is calculated from the data.}

\item{ylim}{The y limits, a two-element numeric vector. If \code{NULL}, then
it is calculated from the data.}

\item{xlab}{The x label.}

\item{ylab}{The y label. If \code{NULL} then it is automatically added based
on the \code{comp} argument.}

\item{\dots}{Additional arguments are passed to \code{\link[=plot]{plot()}}, that is run
before any of the curves are added, to create the figure.}
}
\value{
Nothing.
}
\description{
This function can conveniently plot the results of multiple SIR model
simulations.
}
\details{
The number of susceptible/infected/recovered individuals is plotted over
time, for multiple simulations.
}
\examples{

g <- sample_gnm(100, 100)
sm <- sir(g, beta = 5, gamma = 1)
plot(sm)

}
\references{
Bailey, Norman T. J. (1975). The mathematical theory of
infectious diseases and its applications (2nd ed.). London: Griffin.
}
\seealso{
\code{\link[=sir]{sir()}} for running the actual simulation.

Processes on graphs
\code{\link{time_bins}()}
}
\author{
Eric Kolaczyk (\url{http://math.bu.edu/people/kolaczyk/}) and Gabor
Csardi \email{csardi.gabor@gmail.com}.
}
\concept{processes}
\keyword{graphs}