space_time_ppmify: The space_time_ppmify function

Description Usage Arguments Value

View source: R/space_time_ppmify.R

Description

This function builds off the ppmify function from Nick Golding's ppmify package, converting your case data into a data.frame suitable for applying Poisson regression models.

Usage

1
2
3
space_time_ppmify(points, exposure, covariates = NULL, date_start_end,
  periods = date_start_end, prediction_exposure = exposure,
  approx_num_int_points = 10000, prediction_stack = FALSE)

Arguments

points

sfc object with a 'date' associated with the point in yyyy-mm-dd format

exposure

rasterLayer of exposure (to be used as offset). Required. Raster representing the population over which points arose. Currently only accepts a single raster which is used across all time periods.

covariates

Optional rasterLayer or rasterStack of additional covariates to include. Should be at the same resolution/extent as 'exposure'. If not, will be resampled to the same resolution and extent as 'exposure'.

date_start_end

Required. Vector of 2 values representing the start and end times over which points were observed in yyyy-mm-dd format

periods

Vector of date breaks in yyyy-mm-dd format. Defaults to 'date_start_end' - i.e. assumes a single time period (spatial only)

prediction_exposure

Optional rasterLayer of exposure to be used for prediction. This may be different to 'exposure' if 'points' arose from a different population to that you wish to predict to. Should be at the same resolution/extent as 'exposure'. Defaults to 'exposure'.

approx_num_int_points

Approximate number of integration points to use. Defaults to 10,000.

prediction_stack

Logical. Whether the function should also return a rasterStack of layers required for prediction. Defaults to FALSE.

Value

A data.frame object with the following fields:


disarm-platform/DiSARM documentation built on March 4, 2020, 3:49 p.m.