plot_data: Create spatial pixels data frame

Description Usage Arguments Details Value See Also Examples

View source: R/data_functions.R

Description

Output spatial pixels data frame of lgcp predictions

Usage

1
2
3
4
5
6
7
8
9
plot_data(
  lg,
  covariates,
  per.days = 10000,
  change.lag = NULL,
  relative = TRUE,
  msq = 10000,
  rr_lim = NULL
)

Arguments

lg

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.

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.

Details

This function generates a spatial pixels data frame with the output from lgcp.

Value

A codespatialPolygonsDataFrame

See Also

aggregator_data, plot_hotspot

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_data(lg1,square_pop)

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