Learn R Programming

popEpi (version 0.4.12)

plot.sirspline: plot method for sirspline-object

Description

Plot SIR splines using R base graphics.

Usage

# S3 method for sirspline
plot(x, conf.int = TRUE, abline = TRUE, log = FALSE, type, ylab, xlab, ...)

Value

Always returns `NULL` invisibly. This function is called for its side effects.

Arguments

x

an object returned by function sirspline

conf.int

logical; default TRUE draws also the 95 confidence intervals

abline

logical; draws a reference line where SIR = 1

log

logical; default FALSE. Should the y-axis be in log scale

type

select type = 'n' to plot only figure frames

ylab

overwrites default y-axis label; can be a vector if multiple splines fitted

xlab

overwrites default x-axis label; can be a vector if multiple splines fitted

...

arguments passed on to plot()

Author

Matti Rantanen

Details

In plot.sirspline almost every graphical parameter are user adjustable, such as ylim, xlim. plot.sirsplines calls lines.splines to add lines.

The plot axis without lines can be plotted using option type = 'n'. On top of the frame it's then possible to add a grid, abline or text before plotting the lines (see: sirspline).

See Also

Other sir functions: lines.sirspline(), sir(), sir_exp(), sir_ratio(), sirspline()