leaflet labels overlap fix - leaflet::addMarkers
Solution 1:
You can set the noHide = F
instead of noHide = T
in labelOptions
And you can try adding options = markerOptions(riseOnHover = TRUE)
to get the labels on top of the marker.
Final code would be :
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=markers$long, lat= markers$lat,
popup="The birthplace of R",
label = markers$label,
labelOptions = labelOptions(noHide = F, direction = 'auto'),
options = markerOptions(riseOnHover = TRUE),
clusterOptions = markerClusterOptions()
)