[R] Error with adehabitatHR and kernelbb

David Winsemius dwinsemius at comcast.net
Fri May 17 19:53:30 CEST 2013


On May 17, 2013, at 7:44 AM, Rémi Lesmerises wrote:

> Dear all,
> 
> I'm trying to get a Brownian bridge kernel (kernelbb) for each combination of two consecutive animal locations (see commands below) and put them, with a loop, inside a list. It works well at the beginning but after 42 runs, it appears the following warning :
> 
> 
>> Error in seq.default(yli[1], yli[2], by = diff(xg[1:2])) : 
>>  invalid (to - from)/by in seq(.)
> 
> I looked at the coordinates, at the id, at the time of the run 43 and it's all good...
> 
> I looked on the net and it happened to only one person and there was no answer to his post. 

I wonder if that posting (like yours)  had no data on which to display the problem or to test potential solutions? I would think you would want to post any setup objects and then data for items 40-45.

> 
> Someone could help me?
> 
> ## commands
> 
> BBtraj <- list()
> for (i in 1:(nrow(loc at data)-1)) {
> BBtraj[[i]] <- kernelbb(as.ltraj(loc at coords[i:(i+1),], date=loc at data$time[i:(i+1)], id = as.character(loc at data$id[i:(i+1)]),
> typeII = TRUE), sig1=as.numeric(as.character(loc at data$sig1[i])), sig2= 5, grid = 1000)
> }
> 
-- 


David Winsemius
Alameda, CA, USA



More information about the R-help mailing list