# NOT RUN {
library(leaflet)
library(raster)
## pass a group name only
m <- leaflet() %>%
addProviderTiles("OpenStreetMap") %>%
addCircleMarkers(data = breweries91, group = "breweries91") %>%
addHomeButton(group = "breweries91")
m
## pass a raster extent - group can now be an arbitrary label
m <- leaflet() %>%
addProviderTiles("OpenStreetMap") %>%
addCircleMarkers(data = breweries91, group = "breweries91") %>%
addHomeButton(ext = extent(breweries91), group = "Brew")
m
## remove the button
removeHomeButton(m)
# }
Run the code above in your browser using DataLab