Learn R Programming

realTimeSurv (version 1.0)

plot_hotspot_data: Produce hotspot spatial pixels data

Description

Generate a spatial pixels data frame classifying hotspots and probabilities

Usage

plot_hotspot_data(
  lg,
  covariates,
  threshold.var = NULL,
  threshold.value = NULL,
  labels,
  threshold.prob = 0.8,
  relative = TRUE,
  per.days = 10000,
  msq = 10000
)

Arguments

lg

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.

threshold.var

A vector of one or two strings specifying the variables to define the hotspots, see Details for how to specify.

threshold.value

A vector or one or two values indicating the threshold(s) for determining a hotspot. Given in the same order as threshold.var.

labels

A vector of two or four labels for the hotspots, see Details.

threshold.prob

A vector of one or two values specifying the exceedence probabilities.

relative

A logical value. If one or both of the variable is with respect to a previous time period, whether the comparison should be relative (TRUE) or absolute (FALSE)

per.days

If one or both of the variables is incidence, the denominator number of person-days.

msq

The denominator for the population density in m^2. Default is hectares (per 10,000m^2)

Value

A spatialPixelsDataFrame

Examples

Run this code
# NOT RUN {
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_hotspot_data(lg1,
             covariates = square_pop,
             threshold.var = c("poppp+obs+latent"),
             threshold.value = 1,
             threshold.prob=0.8,
             labels=c('low','high incidence'))
# }

Run the code above in your browser using DataLab