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)

plot of chunk leaft_heatmap

Ref:

  1. https://rpubs.com/bhaskarvk/leaflet-heat
  2. https://github.com/hubentu/tidytuesday/tree/master/data/2019/2019-12-03



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • cmdAgent
  • cmd2cwl
  • Question-Answering Engine with CrewAI and SearXNG
  • RAG with langchain and free google gemini
  • Retrieval augmented generation