neighborhoodVoronoi {cholera}R Documentation

Compute Voronoi pump neighborhoods.

Description

Group cases into neighborhoods using Voronoi tessellation.

Usage

neighborhoodVoronoi(pump.select = NULL, vestry = FALSE,
  case.location = "address", pump.location = "nominal",
  polygon.vertices = FALSE)

Arguments

pump.select

Numeric. Vector of numeric pump IDs to define pump neighborhoods (i.e., the "population"). Negative selection possible. NULL selects all pumps.

vestry

Logical. TRUE uses the 14 pumps from the Vestry report. FALSE uses the 13 in the original map.

case.location

Character. "address" or "nominal". "address" uses the x-y coordinates of ortho.proj. "nominal" uses the x-y coordinates of fatalities.

pump.location

Character. "address" or "nominal". "address" uses the x-y coordinates of ortho.proj.pump or ortho.proj.pump.vestry. "nominal" uses the x-y coordinates of pumps or pumps.vestry.

polygon.vertices

Logical. TRUE returns a list of x-y coordinates of the vertices of Voronoi cells. Useful for sp::point.in.polygon() as used in print.voronoi() method.

Value

An R list with 12 objects.

Examples

neighborhoodVoronoi()
neighborhoodVoronoi(vestry = TRUE)
neighborhoodVoronoi(pump.select = 6:7)
neighborhoodVoronoi(pump.select = -6)
neighborhoodVoronoi(pump.select = -6, polygon.vertices = TRUE)

# coordinates for vertices also available in the returned object.
dat <- neighborhoodVoronoi(pump.select = -6)
dat$coordinates

[Package cholera version 0.7.5 Index]