Learn R Programming

cholera (version 0.4.0)

neighborhoodWalking: Compute walking path pump neighborhoods.

Description

Group cases into neighborhoods based on walking distance.

Usage

neighborhoodWalking(pump.select = NULL, vestry = FALSE, weighted = TRUE,
  case.set = "observed", 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. Exclusion (negative selection) is possible (e.g., -6). Note that you can't just select the pump on Adam and Eve Court (#2): it's a technical isolate.

vestry

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

weighted

Logical. TRUE computes shortest path weighted by road length. FALSE computes shortest path in terms of the number of nodes.

case.set

Character. "observed", "expected" or "snow". "snow" captures John Snow's annotation of the Broad Street pump neighborhood printed in the Vestry report version of the map.

multi.core

Logical or Numeric. TRUE uses parallel::detectCores(). FALSE uses one, single core. You can also specify the number logical cores. On Window, only "multi.core = FALSE" is available.

Value

An R list with 7 objects:

  • paths: list of paths to nearest or selected pump(s).

  • cases: list of cases by pump.

  • vestry: "vestry" from neighborhoodWalking().

  • observed: "observed" from neighborhoodWalking().

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

  • cores: number of cores to use for parallel implementation.

  • metric: incremental metric used to find cut point on split road segments.

Examples

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

Run the code above in your browser using DataLab