Clustering on a Map using R and Leaflet

Yvonne picture Yvonne · Mar 30, 2015 · Viewed 7.6k times · Source

I am using leaflet in R (Just Starting to use it). I like the how the clustering/visualization is done in the post below. The programmer is using Java. What I can not find for leaflet / R, is how to create a cluster circle with number, that is a summary of the number of markers, which response to the number of markers present responding to zooming. I can get the different markers on the map, but not the response to zooming.

Example Leaflet Simple CSV

http://blog.perrygeo.net/2013/09/30/leaflet-simple-csv

If this is is not possible in R/leaflet. What I am trying to show is: one zip code has 10 visits and one zip code has 1 visit. I want to use R/Shiny to create the project. If leaflet is not the best I am open to other options (googlevis?)I am new to mapping so I might be missing something simple...

Thank you so much for your help.

Answer

matt_jay picture matt_jay · Aug 28, 2015

This feature is documented here in the section "Marker Clusters".

You just need to add the option clusterOptions = markerClusterOptions() to your addMarkers() call.