aggregator: Aggregate lgcp output to larger geography

Description Usage Arguments Details Value Examples

View source: R/plot_functions.R

Description

Take a lgcpRealPlot object and aggregates the output to a larger geography specified by a spatialPolygons object.

Usage

1
aggregator(obj, aggpoly, osm = FALSE, verbose = TRUE)

Arguments

obj

An lgcpRealPlot produced by plot or plot_hotspot. NOTE: the call plot or plot_hotspot must have had osm=FALSE set to work with this function.

aggpoly

A spatialPolygons or spatialPolygonsDataFrame object specifying the geography to aggregate to.

osm

A logical value indicating whether to overlay the plot on an OpenStreetMap map

verbose

Logical value indicating whether to show progress bar

Details

This function provides a way of producing aggregated model output for larger geographies. The model fitting takes place on a fine regular lattice, this function provides a way to aggregate this to non-regular polygons such as administrative or political boundaries.

Value

An lgcpRealPlot object comprising a list of two ggplot objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)
p1 <- plot(lg1,square_pop)
aggregator(p1,
           aggpoly=square_pop)

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