smooth.hexbin(bin, weights=c(48,4,1))
If a cell, its immediate, and its second neighbors all have a value of max(bin$count) then the new maximum count is max(bin$count)*sum(weights)*(1+6+12).
Set weights[3]=0 if only immediate neighbors effects are desired.
The current implementation increases the domain attr(bin,"dims") by four rows and four columns, thus reducing plotting resolution.
# Show the smooth counts in gray level smoothbin <- smooth.hexbin(mybin) plot(smoothbin)# Compare the smooth and the origin smbin1 <- smbin smbin1$count <- ceiling(smbin$count/sum(smbin$weights)) plot.hexbin(smbin1) # Expand the domain for comparability smbin2 <- smooth.hexbin(bin, weights=c(1,0,0)) plot.hexbin(smbin2)