[R-sig-eco] AdehabitatHR: LoCoH.k() issue

Nicola Rossi nicola.rossi20 at gmail.com
Mon Oct 13 21:52:30 CEST 2014


Dear sig-eco list,

I am trying to calculate Local Convex Hulls home ranges for a small
dataset using the LoCoh functions of the great adehabitatHR package.

I could calculate successfully the alpha-LoCoh using Getz's rule of
thumb, but there are some troubles with k-LoCoH.
In particular when I try both functions LoCoH.k() and LoCoH.k.area() ,
an error pops up in the console:
Error in polygons(spdf) :
  error in evaluating the argument 'obj' in selecting a method for
function 'polygons': Error in coordinates(coords) :
  error in evaluating the argument 'obj' in selecting a method for
function 'coordinates': Error in pol[[i]][1, ] : incorrect number of
dimensions

Unfortunately I can't provide the data that I'm using at the moment,
but in case it's needed I can make some dummy data.
here's the code that I'm using:
"
library(adehabitatHR)
library(sp)
library(rgdal)
library(maptools)
library(rgeos)
options(digits=10)
data<-read.csv("home_Range.csv",header=TRUE,dec=",")
final<-SpatialPointsDataFrame(data[,2:3],as.data.frame(data[,1]))
LoCoH.k.area(final,k=c(1:5))
##I also tried
LoCoH.k.area(final[,1],k=c(1:5))
##but neither works  "

I thank you very much in advance!

Nicola



More information about the R-sig-ecology mailing list