Ich habe folgenden Datenrahmen.So geben Sie Zahlen in einem Leaflet ein (Kreise)
head(branches)
# A tibble: 6 × 4
population_percentage Lat Long Freq
<chr> <dbl> <dbl> <dbl>
1 0.6 % 41.99575 21.43122 0.005875253
2 0.6 % 41.99575 21.43122 0.006253363
3 0.8 % 41.99575 21.43122 0.008405683
4 1 % 41.98857 21.45733 0.009816326
5 1.1 % 41.99977 21.42708 0.010528918
6 1.2 % 42.00731 21.36529 0.011750505
Mit Faltblatt, plotten ich die Karte.
leaflet(branches) %>% addTiles() %>%
addCircles(lng = ~Long, lat = ~Lat, weight = 10, color = "#03F", opacity = 0.5,
radius = ~sqrt(Freq) * 30, popup = ~ population_percentage
)
Was ich will jetzt zu tun ist, ist im Inneren der Kontributionen (oder Kreise) haben die opulation_percentage wie im Beispiel unten gezeigt.
jedermann?
Ja, im suchen verwenden genau das (https: //github.com/Leaflet/Leaflet.markercluster/blob/master/example/map.png). Aber ich bin nicht sicher, wie man den Code spezifiziert. – Prometheus
'Broschüre (Zweige)%>% addTiles()%>% addCircles (lng = ~ Lang, lat = ~ Lat, Gewicht = 10, color =" # 03F ", Opazität = 0,5, radius = ~ sqrt (Freq) * 30, popup = ~ population_percentage, clusterOptions = markerClusterOptions() ) 'Funktioniert das nicht? – krish
Nein, das habe ich ausprobiert. Ich erhalte den folgenden Fehler: Fehler in addCircles (., Lng = ~ Lang, lat = ~ Lat, Gewicht = 10, color = "# 03F",: unbenutztes Argument (clusterOptions = markerClusterOptions()) – Prometheus