I am trying to map San Francisco's crimes in a map. The below code intends to map every crime (lat, lng) and when the marker is clicked, show the "category" column of the dataset. Right now the below code shows a blank text box when I click the marker. Can anybody help?
sf <- read.csv("https://raw.githubusercontent.com/uwescience/datasci_course_materials/master/assignment6/sanfrancisco_incidents_summer_2014.csv")
crime <- data.frame(lat = c(sf$Y),
lng = c(sf$X))
cat <- c(sf$Category)
library(leaflet)
crime %>%
leaflet() %>%
addTiles() %>%
addMarkers(popup = paste(sf$Category), clusterOptions = markerClusterOptions())