---
title: "Kernel Density Plot"
author: "lindbrook"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Kernel Density Plot}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = ">")
library(cholera)
```

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

```{r fig.width = 5, fig.height = 5, fig.align = "center", echo = TRUE}
snowMap()
addKernelDensity()
```

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:


```{r fig.width = 5, fig.height = 5, fig.align = "center", echo = TRUE}
snowMap()
addKernelDensity(pump.select = c(6, 8))
```

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


```{r fig.width = 5, fig.height = 5, fig.align = "center", echo = TRUE}
snowMap()
addKernelDensity(pump.subset = c(6, 8))
```
