Leaflet SpatialPolygonsDataFrame color

Hi community,
I'm trying to create a map with leaflets.

The map should display a SpatialPolygonsDataFrame, where the Best.partition attribute should be taken into account for coloring.

Consider that the Best.partition can be 2, 3, 4 depending on the number of cluster that we are using.

The code shown here is what I'm using with failure.

pal_1 <- reactive({
  colorBin("RdYlGn",
           domain = Zone()$zone...Best.partition,
           bins = max(unique_zones()))
})

renderLeaflet({

  leaflet() %>%

    addProviderTiles(provider = providers$Esri.WorldImagery) %>%

    addPolygons(data = Zone(),
                fillColor = ~pal_1(zone...Best.partition),
                color = "#black")

})

In fact the console tells me
Warning: Error in pal_1: unused argument (zone...Best.partition)

i am using r mackdown with runtime:shiny

can anyone help me to render well the map?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.