I am trying to estimate home range size using the plug-in method with kernel density estimation in the kernel smoothing (ks) package. Unless there is another way I am not familiar with, in order to calculate spatial area under the space I need to convert my kde () object into a spatial object somehow in order to calculate its spatial area. Could someone demonstrate how this might be done? -- View this message in context: http://old.nabble.com/Export-kde-object-as-shapefile-tp26532782p26532782.html Sent from the R help mailing list archive at Nabble.com.
On Nov 26, 2009, at 12:40 PM, T.D.Rudolph wrote:> > I am trying to estimate home range size using the plug-in method > with kernel > density estimation in the kernel smoothing (ks) package. Unless > there is > another way I am not familiar with, in order to calculate spatial > area under > the space I need to convert my kde () object into a spatial object > somehow > in order to calculate its spatial area. Could someone demonstrate > how this > might be done?Can you explain what you mean by "spatial area under the space" or what it is for which you think there is a well defined area in a ks:::kde object? (Some example data would, as always, be welcome.)> -- > View this message in context: http://old.nabble.com/Export-kde-object-as-shapefile-tp26532782p26532782.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Heritage Laboratories West Hartford, CT
Tyler Dean Rudolph wrote:> > I am trying to estimate home range size using the plug-in method with > kernel density estimation in the kernel smoothing (ks) package. Unless > there is another way I am not familiar with, in order to calculate spatial > area under the space I need to convert my kde () object into a spatial > object somehow in order to calculate its spatial area. Could someone > demonstrate how this might be done? >Here is a plausible solution from the R-sig-geo forum.... On Fri, Nov 27, 2009 at 5:20 PM, Michael Sumner <mdsumner at gmail.com> wrote: 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) -- View this message in context: http://n4.nabble.com/Export-kde-object-as-shapefile-tp853920p919196.html Sent from the R help mailing list archive at Nabble.com.