The data for this map is taken from the Sacramento Crime January 2006 dataset which contains 7,584 crime records as made available by the Sacramento Police Department. The same is available here: http://samplecsvs.s3.amazonaws.com/SacramentocrimeJanuary2006.csv

Reading Data

Reading data from the given url and subsetting to extract 800 random samples out of the 7000+ records.

data <- "http://samplecsvs.s3.amazonaws.com/SacramentocrimeJanuary2006.csv"
df <- read.csv(url(data))
df <- df[sample(nrow(df), 800), c(8,9)]

Plotting Map

The map below shows a clustered view of all the spots where crimes were recorded by the Sacremento Police Department in 2006.

library(leaflet)

df %>%
  leaflet() %>%
  addTiles() %>%
  addMarkers(clusterOptions = markerClusterOptions())