plot.sir {popEpi} | R Documentation |
Plot method for sir-object
Description
Plot SIR estimates with error bars
Usage
## S3 method for class 'sir'
plot(
x,
conf.int = TRUE,
ylab,
xlab,
xlim,
main,
eps = 0.2,
abline = TRUE,
log = FALSE,
left.margin,
...
)
Arguments
x |
an object returned by function |
conf.int |
default TRUE draws confidence intervals |
ylab |
overwrites default y-axis label |
xlab |
overwrites default x-axis label |
xlim |
x-axis minimum and maximum values |
main |
optional plot title |
eps |
error bar vertical bar height (works only in 'model' or 'univariate') |
abline |
logical; draws a grey line in SIR = 1 |
log |
logical; SIR is not in log scale by default |
left.margin |
adjust left marginal of the plot to fit long variable names |
... |
arguments passed on to plot(), segment and lines() |
Details
Plot SIR estimates and confidence intervals
univariate - plots SIR with univariate confidence intervals
model - plots SIR with Poisson modelled confidence intervals
Customize
Normal plot parameters can be passed to plot
. These can be a vector when plotting error bars:
-
pch
- point type -
lty
- line type -
col
- line/point colour -
lwd
- point/line size
Tips for plotting splines
It's possible to use plot
to first draw the
confidence intervals using specific line type or colour and then plotting
again the estimate using lines(... , conf.int = FALSE)
with different
settings. This works only when plot.type
is 'splines'.
Value
Always returns 'NULL' invisibly. This function is called for its side effects.
Author(s)
Matti Rantanen
See Also
Examples
# Plot SIR estimates
# plot(sir.by.gender, col = c(4,2), log=FALSE, eps=0.2, lty=1, lwd=2, pch=19,
# main = 'SIR by gender', abline=TRUE)