Skip to content

as.ltraj in adehabitat

4 messages · Struve, Juliane, Stéphane Dray

#
Juliane,
it seems that you have two relocations observed at the same time. 
Without details (e.g., what did you type in R), it is difficult to give 
you a more precised answer.

Cheers.
Struve, Juliane wrote:

  
    
#
Hello,
many thanks for replying ! In the example there are 4 observations for 18/06/2006, at 4 different times, 2 observations for 05/09/2006 at two different times andso on. My data are in excel files, one per individual.
I use this code to read in and prepare the example data set:

library(PBSmapping)
library(adehabitat)
track_1646=read.table("AllChange_1646R.txt", sep="\t", header=TRUE)
attr(track_1646, "projection") <- c("LL")
track_1646.utm <- convUL(track_1646)
track_1646 <- track_1646.utm
#colnames(track_1646) <- c("X","Y","date","id","burst","Time","ID","VR2number")
id <- as.character(track_1646$id)
burst <- as.character(track_1646$burst)
date <- as.POSIXct(strptime(as.character(track_1646$date),"%d/%m/%Y"))
as.ltraj(track_1646, date, id, burst,typeII = TRUE, slsp = c("remove", "missing"))

The last line yields the error message. I am not really sure about the burst argument, and I do not know why as.traj () needs it. Can you shed light on this ?
Many thanks for your time. 
Juliane
#
Struve, Juliane wrote:
you need to include the "Time" in your date otherwise dates of a same 
day are considered as duplicated.
See ?as.ltraj and you can have a look to C. Calenge, S. Dray, and M. 
Royer-Carenzi. The concept of animals trajectories from a data analysis 
perspective. Ecological Informatics, 4:34-41, 2009. 
(http://pbil.univ-lyon1.fr/members/dray/files/articles/SD857.pdf)