I have used the package adehabitatHR in R to estimate the utilization distribution (UD) of a bird using a custom grid
#make the custom grid
x <- seq(-1723705, 2511295, by = 5000)
y <- seq(7085019, 9240019, by = 5000)
xy <- expand.grid(x=x,y=y)
coordinates(xy) <- ~x+y
gridded(xy) <- TRUE
class(xy)
kde.blsc <- kernelUD(blsc.ptt, h = "href", grid = xy)
#kde.blsc is an `estUD` object
summary(kde.blsc)
I would now like to extract the UD values from kde.blsc to either a SpatialPixelsDataFrame
or a SpatialPolygonsDataFrame
, so that I can link it to habitat variables saved in a separate SpatialPolygonsDataFrame
.
However, when I try to use the function estUDm2spixdf
, I get the following error:
blsc.pix <- estUDm2spixdf(kde.blsc)
Error in estUDm2spixdf(kde.blsc) : x should be of class "estUDm"
How can I turn kde.blsc into a estUDm object? Or are there any alternative methods?