Morning, afternoon or evening.
I have the following positional data (adjusted from 'Count of sampling points within a grid cell')
# Demo data
set.seed(123)
#
lat <- runif(1000, 46.5, 48.5)
lon <- runif(1000, 13,16)
#
pos <- data.frame(lon, lat)
Using the following:
ggplot(pos, aes(x = lon, y=lat)) +
geom_bin2d(bins = 25) +
stat_bin_2d(aes(label=stat(count)), bins = 25, position="identity") +
scale_fill_gradient(low = "white", high = "red")+
theme_void()
gives:
Awesome, but,
I want to do the exact same in leaflet but cannot seem to find a straightforward solution. In reality I have over 5,000,000 data points.
Preferable when running the mouse over the cell, or using leaflets popup functionality, the number of data points for the cell will be shown.