library(leaflet)
map = leaflet() %>%
addProviderTiles("OpenStreetMap", group = "OSM") %>%
addProviderTiles("CartoDB.DarkMatter", group = "dark") %>%
addCircleMarkers(data = breweries91, group = "brew")
map # no layers control
map %>%
updateLayersControl(addBaseGroups = c("OSM", "dark"),
addOverlayGroups = "brew")
Run the code above in your browser using DataLab