Hi,
This looks to be exactly the solution i am looking for- I am analysing
some telemetry data in a reservoir which is too complex to meet the
boundary rules.
However I am having a little trouble with the example code....its
probably something I have done but.....
library(adehabitatHR)
data(puechabonsp)
loc <- puechabonsp$relocs
elev <- puechabonsp$map
fullgrid(elev) <- TRUE
hab <- elev
hab[[1]] <- as.numeric(!is.na(hab[[1]]))
#everything works good up till here
ud <- kernelUD(loc[,1], grid=hab)
#when i get to this point I get the following error message
error in .kernelUDs(SpatialPoints(x, proj4string =
CRS(as.character(pfs1))), :
grid should be a number or an object inheriting the class SpatialPixels
#i notice that when I run
[1] "SpatialGridDataFrame"
attr(,"package")
[1] "sp"
#it appears to be a class SpatialGridDataFrame. and the grid function
needs to be of the class SpatialPixels
#so I tried
hab<-SpatialPixels(hab)
however this doesnt seem to work i get the error
Error in SpatialPixels(hab) :
points should be of class or extending SpatialPoints
I am a bit of a beginner using sp and adehabitathr packages so i expect it
is something silly
however I just cant seem to recetify this
Thanks for your time
Phil H