erode.hexbin(bin, cdfcut=0.5)
The erode component of the resulting object (a data frame) contains an erosion number for each cell. The value of erode is six times the erosion cycle at cell removal minus the cell deficit at removal.
Cells with low values are eroded first. The cell with the highest erosion number is a candidate bivariate median. A few ties in erode are common.
smbin <- smooth.hexbin(bin) erobin <- erode.hexbin(smbin)# Show erosion order screenpar <- plot(erobin, style="lat", minarea=1, maxarea=1, density=0, border=T) oldpar <- par(screenpar) # Reset graphical parameters xy <- cell2xy(erobin) text(xy$x,xy$y,as.character(erobin$erode)) par(oldpar) # Restore old graphical parameters