library(leaflet)
df <- data.frame(lat = c(10.725992738139567,10.781520881069099 ,10.765480189659854),
lng = c(106.61166554047178,106.70074490237916,106.9567795023791),
col = c("Red","Blue","Yellow"),
label = c("Home","Office","Highway")
)
assignment2 <- df %>%
leaflet() %>%
addTiles() %>%
addCircleMarkers(color = df$col) %>%
addLegend(labels = df$label,colors = df$col)
## Assuming "lng" and "lat" are longitude and latitude, respectively
assignment2