[R-sig-Geo] Convert kde object into spatial object

Michael Sumner mdsumner at gmail.com
Fri Nov 27 23:20:59 CET 2009


Here's one way:

library(ks)

data(unicef)
H.scv <- Hscv(x=unicef)
fhat <- kde(x=unicef, H=H.scv)
image(fhat$eval.points[[1]], fhat$eval.points[[2]], fhat$estimate)


library(sp)


spkde <- image2Grid(list(x = fhat$eval.points[[1]], y =
fhat$eval.points[[2]], z = fhat$estimate))
contour(spkde, add = TRUE)





On Sat, Nov 28, 2009 at 7:53 AM, Tyler Dean Rudolph
<prairie.picker at gmail.com> wrote:
>  Is there a way to convert a kde object (ks package) into a spatial object
> (e.g. SpatialPixels, SpatialPolygons) for export into a GIS?  Alternatively,
> is there a way to generate the 2-D spatial area underneath the 3-D
> utilisation distribution of a kde object?  I have explored the package
> descriptions and help forums and have not yet found a solution....
>
> Tyler
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list