xy2cell(x, y, xbins=30, shape=1, xlim=range(x), ylim=range(y))
This function can be used to compute statistics per cell. See the EXAMPLES below for one such instance.
ozone.bin <- hexbin(ozone.xy$x, ozone.xy$y, xbins=8)
ozone.cells <- xy2cell(ozone.xy$x, ozone.xy$y, xbins=8)
# Find the median of each hexagonal cell:
ozone.angle <- tapply(ozone.median,ozone.cells,median)
map(region=c("new york","new jersey","conn","mass"),lty=2)
rayplot(ozone.bin$xcenter,ozone.bin$ycenter,ozone.angle)