Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.survRes

Plot a survRes object


Description

Plotting a (multivariate) survRes object. The internal function plot.survRes.one is used as a helper function to plot a univariate time series.

Usage

## S3 method for class 'survRes'
plot(x, method=x$control$name, disease=x$control$data, 
  xaxis.years=TRUE,startyear = 2001, firstweek = 1, same.scale=TRUE, ...)

  plot.survRes.one(x, method=x$control$name, disease=x$control$data,
   domany=FALSE,ylim=NULL,xaxis.years=TRUE,startyear = 2001, firstweek = 1, 
   xlab="time", ylab="No. infected", main=NULL, type="hhs",
   lty=c(1,1,2),col=c(1,1,4), 
   outbreak.symbol = list(pch=3,col=3),alarm.symbol=list(pch=24,col=2),
   legend.opts=list(x="top",
   legend=c("Infected", "Upperbound", "Alarm", "Outbreak"),
   lty=NULL,col=NULL,pch=NULL), ...)

Arguments

x

object of class survRes

method

surveillance method to be used in title

disease

name of disease in title

xaxis.years

Boolean indicating whether to show a year based x-axis for weekly data

domany

Boolean telling the function whether it is called for a multivariate (TRUE) or univariate (FALSE) survRes object. In case of TRUE no titles are drawn.

ylim

range of y axis

startyear

year to begin the axis labeling (the year where the oldest data come from)

firstweek

number of the first week of January in the first year (just for axis labeling reasons)

xlab

label of the x-axis

ylab

label of the y-axis

main

the title of the graphics is generated from the method and disease arguments if not specified otherwise

same.scale

plot all time series with the same ylim? Defaults to true

.

type

line type of the observed counts (first two elements) and the upper bound (third element)

lty

vector of size 3 specifying the line type of the observed counts (left, right) and the upperbound line

col

vector with three elements: color of left bar and color of top bar, color of right bar, col of the upperbound line.

outbreak.symbol

list with entries pch and col specifying the plot symbol

alarm.symbol

list with entries pch and col specifying the plot symbol

legend.opts

a list containing the entries to be sent to the legend function. If no legend is requested use legend.opts=NULL. Otherwise, the following arguments are default

x

top

legend

The names infected and outbreak.

lty

If NULL the lty argument will be used

pch

If NULL the pch argument is used

col

If NULL the col argument is used

Any further arguments to the legend function are just provided as additional elements of this list, e.g. horiz=TRUE.

...

arguments passed to plot.survRes.one. From there, further arguments are passed to matplot.

Value

none. A plot showing the number of infected, the threshold for recognizing an outbreak, the alarm status and the outbreak status is generated.

Author(s)

M. Höhle

Examples

data(ha)
ctrl <- list(range = 209:290, b = 2, w = 6, alpha = 0.005)
plot(algo.bayes(aggregate(ha), control = ctrl))

surveillance

Temporal and Spatio-Temporal Modeling and Monitoring of Epidemic Phenomena

v1.19.1
GPL-2
Authors
Michael H<f6>hle [aut, ths] (<https://orcid.org/0000-0002-0423-6702>), Sebastian Meyer [aut, cre] (<https://orcid.org/0000-0002-1791-9449>), Michaela Paul [aut], Leonhard Held [ctb, ths], Howard Burkom [ctb], Thais Correa [ctb], Mathias Hofmann [ctb], Christian Lang [ctb], Juliane Manitz [ctb], Andrea Riebler [ctb], Daniel Saban<e9>s Bov<e9> [ctb], Ma<eb>lle Salmon [ctb], Dirk Schumacher [ctb], Stefan Steiner [ctb], Mikko Virtanen [ctb], Wei Wei [ctb], Valentin Wimmer [ctb], R Core Team [ctb] (A few code segments are modified versions of code from base R)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.