Tidytuesday Leaflet Heatmap
TidyTuesday: Leaflet heatmap for Philadelphia Parking Violations
library(tidyverse)
library(leaflet)
library(leaflet.extras)
tickets <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-12-03/tickets.csv")
llm <- tickets %>% summarise(lat_m = mean(lat), lon_m = mean(lon))
leaflet(tickets) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
setView(llm$lon_m, llm$lat_m, 11) %>%
addHeatmap(lng = ~lon, lat = ~lat, intensity = ~fine,
blur = 20, max = 0.05, radius = 15)
Ref:
Enjoy Reading This Article?
Here are some more articles you might like to read next: