Learn R Programming

cholera (version 0.4.0)

addKernelDensity: Add 2D kernel density contours.

Description

Uses KernSmooth::bkde2D().

Usage

addKernelDensity(pump.subset = "pooled", pump.select = NULL,
  neighborhood.type = "walking", obs.unit = "unstacked", bandwidth = 0.5,
  color = "black", line.type = "solid", multi.core = FALSE, ...)

Arguments

pump.subset

Character or Numeric: "pooled", "individual", or numeric vector of observed pump neighborhoods (3 through 12 or [3, 12]). The vector of pumps to select (subset) from neighborhoods defined by "pump.select". Negative selection possible.

pump.select

Numeric. Vector of pumps to consider. This creates a scenario where the only pumps are those in the vector (negative selection possible).

neighborhood.type

Character. "voronoi" or "walking"

obs.unit

Character. Unit of observation. "unstacked" uses fatalities.unstacked. "address" uses fatalities.address. "fatality" uses fatalities.

bandwidth

Numeric. Bandwidth for kernel density estimation.

color

Character. Color of contour lines.

line.type

Character. Line type for contour lines.

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.

...

Additional plotting parameters.

Value

Add contours to a graphics plot.

See Also

snowMap, addIndexCase, addLandmarks, addPlaguePit, addSnow, addVoronoi, addWhitehead

Examples

Run this code
# NOT RUN {
# snowMap()
# addKernelDensity()

# snowMap()
# addKernelDensity("individual")

# snowMap()
# addKernelDensity(c(6, 8))

# snowMap()
# addKernelDensity(pump.select = c(6, 8))
# }

Run the code above in your browser using DataLab