[R] RE: Kernel Density Estimator for 2D Binned Data

Nicholas Lewin-Koh nikko at hailmail.net
Thu Feb 12 09:56:50 CET 2004


Hi James,
You can try the hexbin package at www.bioconductor.org. Do the following

bin<-hexbin(x,y)
## This will give you hexagonal bins of the data
binsm<-smooth.hexbin(bin)
plot(binsm)

This is an approximation to what you want. The other way is to use a 2d
bspline 
on the bin center of masses of the hexagons and use the bin counts as
weights.

Nicholas




More information about the R-help mailing list