cholera (version 0.2.1)

neighborhoodWalking: Compute walking path neighborhoods.

Description

Data for walking neighborhoods for John Snow's 1854 London cholera data.

Usage

neighborhoodWalking(pump.select = NULL, vestry = FALSE,
  statistic = "address", weighted = TRUE, snow = FALSE,
  multi.core = 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

Character. "address" computes the number of addresses in each selected pump neighborhood. "fatality" computes the number of fatalities in pump neighborhoods.

weighted

Logical. TRUE uses distance weighted by edge length (i.e., road length). FALSE uses unweighted distance.

snow

Logical. TRUE computes Snow's Broad Street pump neighborhood. Note: this sets "pump.select" to 7 and "vestry" to NULL.

multi.core

Logical or Numeric. TRUE uses parallel::detectCores(). FALSE uses one, single core. With Numeric, you specify the number logical cores (rounds with as.integer()). On Windows, only "multi.core = FALSE" is available.

Value

An R list with 12 objects:

  • distances: walking distances to selected pumps.

  • pump: vector of selected pumps.

  • nearest.pump: an observed fatality's nearest pump.

  • pump.seg: "trimmed" neighborhood road segments based on observed fatalities.

  • pump.case: observed fatality IDs by pump neighborhood.

  • sim.pump.seg: "trimmed" neighborhood road segments based on simulated fatalities.

  • sim.pump.case: simulated fatality ID by pump neighborhood.

  • observed: observed neighborhood fatality counts.

  • expected: expected neighborhood fatality counts, based on road length.

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

  • statistic: "statistic" from neighborhoodWalking().

  • vestry: "vestry" from neighborhoodWalking().

Notes

This function is computationally intensive (the default configuration takes about 1-2 minutes to run on a single core). However, seven configurations will return pre-computed results. The first three use the 13 pumps in the original map: 1) the default set of arguments, which uses all pumps; 2) the default set excluding the pump on Little Marlborough Street (pump 6), and 3) the default set with just the Little Marlborough Street and the Broad Street pumps (6 and 7). The next three use the same set of arguments as above but uses the 14 pumps in the second version from the Vestry report. This includes a repositioned Broad Street pump. The seventh and final is Snow's Broad Street pump neighborhood, which represents his graphical annotation of the version of the map that appeared in the Vestry report.

See Also

plot.walking, summary.walking, vignette("pump.neighborhoods")

Examples

Run this code
# NOT RUN {
neighborhoodWalking()
neighborhoodWalking(pump.select = -6)
# }

Run the code above in your browser using DataLab