I usually made this maps for the field
leaflet() %>%
addTiles() %>%
setView(-71.0382679, 42.3489054, zoom = 18) %>%
addEasyButton(easyButton(
icon="fa-crosshairs", title="Locate Me",
onClick=JS("function(btn, map){ map.locate({setView: true, enableHighAccuracy: true }); }")))
leaflet() %>%
addTiles() %>%
setView(-71.0382679, 42.3489054, zoom = 18) %>%
htmlwidgets::onRender("
var lc = L.control.locate({
position: 'topright'}
}).addTo(map);")