Is there any way to select or highlight data on a leaflet map in by clicking on the legend in Rshiny?
example code:

```
library(shiny)
library(leaflet)
library(RColorBrewer)
library(leafletGeocoderRshiny)

ui <- fluidPage(
  leafletOutput("map"),
  p(),
  actionButton("recalc", "New points")
)

server <- function(input, output, session) {

  df = data.frame(x = rnorm(100), y = rexp(100, 2), z = runif(100))
  pal = colorBin('PuOr', df$z, bins = c(0, .1, .4, .9, 1))

  output$map <- renderLeaflet({ leaflet(df) %>%
    addCircleMarkers(~x, ~y, color = ~pal(z)) %>%
    addLegend(pal = pal, values = ~z)
  })

}

shinyApp(ui, server) 

```