KernelUD error or R code error ... :S

View: New views
1 Messages — Rating Filter:   Alert me  

KernelUD error or R code error ... :S

by Gustavo Palminha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.
I've started recently using the adehabitat package with R 2.8.1 and i've been facing a strange error.

My main goal is to calculate kernelUD from shapefiles and send the results as a surface/shapefile so using this shapefile with random points here (http://www.yousendit.com/transfer.php?action=batch_download&batch_id=UmNMMWZPK3gwMEd4dnc9PQ) i've been trying to run this code and i get an error on the last line.

The code is:

## load lbs
library(adehabitat)
library(shapefiles)


## load shapefile
shpobj <- read.shp("C:/Temp/2008.shp")
## convert it to simple X,Y
cds <- convert.to.simple(shpobj)

## get assure the XY coordinates are in here
xy <- cds[,1:2]

## run kernelud
hr<-kernelUD(xy, h="LSCV", grid=100)
 ------------> "Error in df[, 1] : incorrect number of dimensions" <------------

Any help on this would be appreciated.

Regards.