Kernel Density Plot

knitr::opts_chunk$set(collapse = TRUE, comment = ">")
library(cholera)

By default, the addKernelDensity() function pools all observations:

snowMap()
addKernelDensity()
snowMap()
addKernelDensity(multi.core = FALSE)

However, this presuppose that all cases have a common source. To consider the possible existence of multiple pump neighborhoods, the function provides two ways to explore hypothetical scenarios.

By using the pump.select argument, you can define a "population" of pump neighborhoods by specify the pumps to consider:

snowMap()
addKernelDensity(pump.select = c(6, 8))
snowMap()
addKernelDensity(pump.select = c(6, 8), multi.core = FALSE)

By using the pump.subset argument, you can define the subset of the "population" to consider:

snowMap()
addKernelDensity(pump.subset = c(6, 8))
snowMap()
addKernelDensity(pump.subset = c(6, 8), multi.core = FALSE)


Try the cholera package in your browser

Any scripts or data that you put into this service are public.

cholera documentation built on April 22, 2021, 9:08 a.m.