Erode a Hexagonally Binned Image

DESCRIPTION:

Algorithm to remove counts from hexagonal cells at a rate proportional to the cell's exposed surface area. When a cell becomes empty, the cell is removed and its removal order noted. Cell removal increases the exposure of neighboring cells. The last cell removed is a type of bivariate median.

USAGE:

erode.hexbin(bin, cdfcut=0.5) 

REQUIRED ARGUMENTS:

bin
an object of class "hexbin".

OPTIONAL ARGUMENTS:

cdfcut
numeric value giving the fraction of the total counts to be extracted. All cells will be extracted if cdfcut=0.

VALUE:

an object of class "hexbin" with high count cells and a component named erode which gives the erosion order.

DETAILS:

The algorithm performs gray-level erosion on the extracted cells. Each erosion cycle removes counts from cells. The counts removed for each cell are a multiple of the cell's exposed-face count. The algorithm chooses the multiple so that at least one cell will be empty or have a count deficit on each erosion cycle.

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.

REFERENCES:

Carr, D. B. (1991). Looking at large data sets using binned data plots. In Computing and Graphics in Statistics. A. Buja and P. Tukey, eds. Springer-Verlag, New York. pp. 7-39.

SEE ALSO:

, , .

EXAMPLES:

bin <- hexbin(rnorm(500),rnorm(500)) 
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