--- 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, `addKernelDensity()` pools all observations into a single neighborhood: ```{r fig.width = 5, fig.height = 5, fig.align = "center"} snowMap() addKernelDensity() ``` To consider the possibility of multiple pump neighborhoods, you can do the following. To define a set of neighborhoods based on a selection of pumps (i.e., distribute cases across the selection), use the `pump.select` argument : ```{r fig.width = 5, fig.height = 5, fig.align = "center"} snowMap() addKernelDensity(pump.select = c(6, 8)) ``` To view the subset of "local" neighborhoods you're interested in, use the `pump.subset` argument. ```{r fig.width = 5, fig.height = 5, fig.align = "center"} snowMap() addKernelDensity(pump.subset = c(6, 8)) ```