Sorry for being late
knitr::opts_chunk$set(echo = TRUE)
library("leaflet")
df<- data.frame(lat = c(38.5816, 37.7749, 34.0522),
lng = c(-121.4944, -122.4194, -118.2437),
pop = c("Eat", "Sleep", "Drink"),
col = c("red", "green", "blue"),
plc = c("Sac", "SF", "LA"),
stringsAsFactors = FALSE)
myMap<- df %>%
leaflet() %>%
addTiles() %>%
addCircleMarkers(popup = df$pop, color = df$col) %>%
addLegend(labels = df$plc, colors = df$col)
## Assuming 'lng' and 'lat' are longitude and latitude, respectively
myMap