[AniMov] Adehabitat - kernelUD function
Clément Calenge
calenge at biomserv.univ-lyon1.fr
Sat Oct 21 09:09:46 CEST 2006
Hi Leslie,
> Hi -
> I have been using Adehabitat to estimate home ranges with
> the kernelUD function. I used a 30 meter DEM for my grid
> and would like to export the pixel values, merge them with other
> covariates of the same format and use them in another package in R.
> Specifically, I am interested in the z -values for each pixel within
> the 30 meter DEM file. Could someone tell me how to extract
> and export the results for each pixel?
>
The map of the UD of animal i is stored in the component $UD of the
component i of the object returned by the function kernelUD. For example
(just copy and paste in R):
data(puechabon)
DEM <- getkasc(puechabon$kasc,1)
locs <- puechabon$locs
## estimates the UD for each animal
kud <- kernelUD(locs[,c("X","Y")], locs$Names, grid=DEM)
## For the first animal (Brock), the UD is stored in the component
## UD of the first component of the list:
mapUDBrock <- kud[[1]]$UD
image(mapUDBrock)
## this map can be exported toward a GIS thanks to export.asc.
## It can be converted to SpatialPixelsDataFrame (package sp)
## thanks to asc2spixdf()
## alternatively, you can export the UD maps for all animals:
allUD <- as.kasc(lapply(kud, function(x) x$UD))
## It can be converted to SpatialPixelsDataFrame (package sp)
## thanks to kasc2spixdf()
Hope this helps,
Clément.
More information about the AniMov
mailing list