Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. renderLeaflet ({
  2.  
  3. pal8 <- c("#FFFFE5", "#D9F0A3", "#78C679", "#006837")
  4. bins=quantile(mapdata_1()$Per), na.color = "#808080", alpha = FALSE, reverse = F)
  5. pal <- colorFactor(palette = pal8, domain =NULL, levels=(mapdata_1()$cat), ordered = TRUE, na.color = "#808080", alpha = FALSE, reverse = F)
  6.  
  7. leaflet (mapdata_()) %>%
  8.  
  9. addProviderTiles("CartoDB.Positron") %>%
  10. clearControls() %>%
  11. clearShapes()%>%
  12. addPolygons(fillColor = ~pal(cat)) %>%
  13.  
  14.  
  15.  
  16. addTiles() %>%
  17.  
  18. setView(-82.706838, 40.358615, zoom=7) %>%
  19.  
  20. addLegend(position = "bottomright",
  21. values = ~cat,
  22.  
  23. pal = pal,
  24. title = (paste("%",input$Age_Group_map, input$sex_map, "in", input$Year_map)) ,
  25. labFormat = labelFormat(
  26. ))
  27.  
  28. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement