plot.lgcpReal: Real-time surveillance plot

Description Usage Arguments Value See Also Examples

View source: R/plot_functions.R

Description

Plot incidence, model components, and their changes over time.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'lgcpReal'
plot(
  x,
  covariates,
  osm = FALSE,
  per.days = 10000,
  change.lag = NULL,
  relative = TRUE,
  msq = 10000,
  rr_lim = NULL,
  ...
)

Arguments

x

An lgcpReal object, output from a call to lgcp

covariates

A spatialPolygonsDataFrame covering the area of interest and containing the covariate and population density data. Typically the same object as specified in the covariates argument in the call to lgcp.

osm

A logical value whether a map from OpenStreetMap should be included in the plots.

per.days

Integer, the number of person-days to use for incidence, default is 10,000.

change.lag

If not NULL, then plots are created of the change in outputs compared to this number of periods prior.

relative

A logical value indicating whether the comparisons (if change.lag set) should be relative (default), i.e. incidence rate ratios and ratios of relative risks, or absolute.

msq

Integer, the denominator of the population density, default is hectares (population per 10,000m^2)

rr_lim

Integer, for plotting the relative risk, the maximum value of the colour scale. Useful when comparing multiple plots to put colour gradient on same scale.

...

...

Value

A list of two ggplot objects. The first is the incidence (or change in incidence) the second is a plot of four components: (i) the expected case count in each cell, (ii) the relative risk due to included covariates, (iii) the relative risk associated with the latent Gaussian process, and (iv) the posterior standard deviation of the incidence. An object outl is exported to the global environment to reduce needing to reload sampling data on further calls to the same lgcpReal object. This can be removed if needed as it can be large.

See Also

aggregator, plot_hotspot, generate_report

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(dat,square,square_pop)
lg1 <- lgcp(data=dat,
            pop.var = c("popdens"),
            boundary=square,
            covariates=square_pop,
            cellwidth=0.1,
            laglength = 7,
            mala.pars=c(200,100,1),
            nchains=2)
plot(lg1,square_pop)

realTimeSurv documentation built on May 18, 2021, 9:07 a.m.