kde_map {rcrimeanalysis} | R Documentation |
Kernel Density Estimation and Heat Map Generation for Crime Incidents
Description
This function computes a kernel density estimate of crime incident locations and returns a 'Leaflet' map of the incidents. The data is based on the Chicago Police Department RMS structure and populates pop-up windows with the incident location for each incident.
Usage
kde_map(data, pts = NULL)
Arguments
data |
Data frame of crime or RMS data. See provided Chicago Data Portal example for reference |
pts |
Either true or false. Dictates whether the incident points will
be plotted on the map widget. If |
Value
A Leaflet map with three layers: an 'ESRI' base-map, all crime incidents plotted (with incident info pop-up windows), and a kernel density estimate of those points.
Author(s)
Jamie Spaulding, Keith Morris
Examples
#Using provided dataset from Chicago Data Portal:
data(crimes)
crimes <- head(crimes, 1000)
library('leaflet') # needed to install basemap providers
kde_map(crimes)
[Package rcrimeanalysis version 0.5.0 Index]