我正在寻找一种解决方法来解决使用R函数leaflet::addMarkers时标签重叠的问题。
long <- c(147.768, 147.768, 147.768,147.768, 147.768, 147.768)
lat <- c(-36.852, -36.852, -36.852,-36.852, -36.852, -36.852)
label <- c('long label1', 'long label2', 'long label3','long label4', 'long label5', 'long label6')
markers <- data.frame(lat,long,label)
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 = T, direction = 'auto'),
clusterOptions = markerClusterOptions()
)
ggrepel
(参见http://blog.revolutionanalytics.com/2016/01/avoid-overlapping-labels-in-ggplot2-charts.html)。 - JanLauGe