This is the problematic data, especially the line 43, but when I removed that line, it bugs at line 62 and so on. sig1 time id UTMnorthin UTMeasting 40 4.5766 2012.05.30 08:00:00 Ade-55419576 390052 41 4.5766 2012.05.30 10:00:00 Ade-55419581 390058 42 4.5766 2012.05.30 12:00:00 Ade-55419560 390045 43 4.5766 2012.05.30 14:00:00 Ade-55419574 390051 44 4.5766 2012.05.30 16:00:00 Ade-55419490 390051 45 4.5766 2012.05.30 18:00:00 Ade-55419435 390293 46 4.5766 2012.05.30 20:00:00 Ade-55419661 390876 47 4.5766 2012.05.30 22:00:00 Ade-55419934 390673 48 4.5766 2012.05.31 02:00:00 Ade-55420636 389777 49 4.5766 2012.06.05 02:00:00 Ade-75419275 391206 50 4.5766 2012.06.05 04:00:00 Ade-75419276 391202 This is a data frame so before the loop (see commands in the previous mail below), I transform with the following commands: >coordinates(fece)<-~UTMeasting+UTMnorthin >fece@data$time <- as.POSIXct(strptime(as.character(fece@data$time),"%Y.%m.%d >%H:%M:%S")) Rémi Lesmerises, biol. M.Sc., PH.D candidate Université du Québec à Rimouski ________________________________ De : David Winsemius <dwinsem...@comcast.net> À : Rémi Lesmerises <remilesmeri...@yahoo.ca> Cc : "r-help@r-project.org" <r-help@r-project.org> Envoyé le : vendredi 17 mai 2013 13h53 Objet : Re: [R] Error with adehabitatHR and kernelbb 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@data)-1)) { > BBtraj[[i]] <- kernelbb(as.ltraj(loc@coords[i:(i+1),], > date=loc@data$time[i:(i+1)], id = as.character(loc@data$id[i:(i+1)]), > typeII = TRUE), sig1=as.numeric(as.character(loc@data$sig1[i])), sig2= 5, > grid = 1000) > } > -- David Winsemius Alameda, CA, USA [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.