Hexbin Layer Demo

df <- tibble(
  lat = rnorm(100),
  lng = rnorm(100)
)

df2 <- tibble(
  lat =  42.9634 + rnorm(1000),
  lng = -85.6681 + rnorm(1000)
)

df3 <- tibble(
  lat =  51.8126 + rnorm(1000),
  lng = 5.8372 + rnorm(1000)
)

df4 <- tibble(
  lat =  30.2460 + rnorm(1000),
  lng = -87.7008 + rnorm(1000)
)
leaflet::leaflet(df, width = 600, height = 300) %>% 
  addTiles() %>% 
  addHexbin(
    radius = 19, 
    lowEndColor = "yellow", 
    highEndColor="red") %>%
  addHexbin(
    data = df2,
    radius = 16, 
    lowEndColor = "lightblue", 
    highEndColor="purple") %>%
  addHexbin(
    data = df3,
    uniformSize = TRUE,
    lowEndColor = 'yellow',
    highEndColor = 'red') %>%
  addHexbin(
    data = df4,
    uniformColor = 'green',
    radius = 18)