if (FALSE) {
## Load the data
data(puechabonsp)
## The relocations:
locs <- puechabonsp$relocs
locsdf <- as.data.frame(locs)
head(locsdf)
## Shows the relocations
plot(locs, col=as.numeric(locsdf[,1]))
## Examinates the changes in home-range size for various values of k
## Be patient! the algorithm can be very long
ar <- LoCoH.k.area(locs[,1], k=c(8:13))
## 12 points seems to be a good choice (rough asymptote for all animals)
## the k-LoCoH method:
nn <- LoCoH.k(locs[,1], k=12)
## Graphical display of the results
plot(nn, border=NA)
## the object nn is a list of objects of class
## SpatialPolygonsDataFrame
length(nn)
names(nn)
class(nn[[1]])
## shows the content of the object for the first animal
as.data.frame(nn[[1]])
## The 95% home range is the smallest area for which the
## proportion of relocations included is larger or equal
## to 95% In this case, it is the 22th row of the
## SpatialPolygonsDataFrame.
## The area covered by the home range is for this first animal
## equal to 22.87 ha.
## shows this area:
plot(nn[[1]][11,])
## rasterization of the home ranges:
## use the map of the area:
image(puechabonsp$map)
ras <- MCHu.rast(nn, puechabonsp$map, percent=100)
opar <- par(mfrow=c(2,2))
lapply(1:4, function(i) { image(ras,i); box()})
par(opar)
## r-LoCoH and a-LoCoH can be applied similarly
}
Run the code above in your browser using DataLab