Leaflet assignment

To get some locations to put on our map, let’s first randomize some coordinates:

set.seed(1)
lat = runif(3, -100, 100)
long = runif(3, -50, 50)
description = c("Location 1", "Location 2", "Location 3")
df <- data.frame(lat, long, description)

Now let’s draw the map:

df %>%
    leaflet() %>%
    addTiles() %>%
    addMarkers(popup = description)
## Assuming "long" and "lat" are longitude and latitude, respectively