cholera (version 0.2.1)

neighborhoodVoronoi: Compute Voronoi neighborhoods.

Description

Data for Voronoi tessellation of John Snow's 1854 London cholera data.

Usage

neighborhoodVoronoi(pump.select = NULL, vestry = FALSE, statistic = NULL,
  polygon.vertices = FALSE)

Arguments

pump.select

Numeric. Default is NULL: all pumps are used. Otherwise, selection by a vector of numeric IDs: 1 to 13 for pumps; 1 to 14 for pumps.vestry.

vestry

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

statistic

NULL or Character. NULL, the default, makes no summary computation. "address" computes the number of addresses in each selected pump neighborhood. "fatality" computes the number of fatalities in pump neighborhoods.

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 summary.voronoi() method.

Value

An R list with 12 objects.

  • pump.id: vector of selected pumps

  • voronoi: output from deldir::deldir().

  • snow.colors: neighborhood color based on snowColors().

  • x.rng: range of x for plot.

  • y.rng: range of y for plot.

  • select.string: description of "pump.select" for plot title.

  • expected.data: expected neighborhood fatality counts, based on Voronoi cell area.

  • coordinates: polygon vertices of Voronoi cells.

  • statistic.data: observed neighborhood fatality counts.

  • pump.select: "pump.select" from neighborhoodVoronoi().

  • statistic: "statistic" from neighborhoodVoronoi().

  • vestry: "vestry" from neighborhoodVoronoi().

See Also

addVoronoi, plot.voronoi, summary.voronoi, vignette("pump.neighborhoods")

Examples

Run this code
# NOT RUN {
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 returned object.
dat <- neighborhoodVoronoi(pump.select = -6)
dat$coordinates
# }

Run the code above in your browser using DataCamp Workspace