plot.earlyR: Plot earlyR objects

Description Usage Arguments Author(s)

View source: R/plot.earlyR.R

Description

These functions are designed for plotting earlyR objects, output by the function get_R. It can plot either the likelihood of R values, or the force of infection over time (see argument type). For points, the latter is used.

Usage

1
2
3
4
5
## S3 method for class 'earlyR'
plot(x, type = c("R", "lambdas"), scale = 1, ...)

## S3 method for class 'earlyR'
points(x, scale = 1, ...)

Arguments

x

A earlyR object.

type

The type of graphic to be generated, matching either "R" or "lamdbas"; "R" will plot the likelihood of R values; "lambdas" will plot the force of infection over time.

scale

A numeric value indicating the scaling factor for lambdas on the 'y' axis.

...

Further arguments to be passed to other methods (not used).

if (require(incidence))

## example: onsets on days 1, 5, 6 and 12; estimation on day 24 onset <- c(1, 5, 6, 12) x <- incidence(onset, last_date = 24) x

res <- get_R(x, disease = "ebola") res plot(res) plot(res, "lambdas") plot(res, "lambdas", scaling = 5) points(onset, 1:4, cex = 3, pch = 20)

Author(s)

Thibaut Jombart thibautjombart@gmail.com


earlyR documentation built on May 2, 2019, 7:58 a.m.

Related to plot.earlyR in earlyR...