[R-sig-eco] as.ltraj in adehabitat
Stéphane Dray
dray at biomserv.univ-lyon1.fr
Sat Mar 28 09:14:56 CET 2009
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"))
>
you need to include the "Time" in your date otherwise dates of a same
day are considered as duplicated.
> 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.
>
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)
> Juliane
>
>
> ________________________________________
> From: Stéphane Dray [dray at biomserv.univ-lyon1.fr]
> Sent: 27 March 2009 15:01
> To: Struve, Juliane
> Cc: r-sig-ecology at r-project.org
> Subject: Re: [R-sig-eco] as.ltraj in adehabitat
>
> 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:
>
>> Dear list,
>>
>> I am trying to convert a dataframe into an ltraj object and have a hard time defing the burst argument. The data consist of locations, dates and time for only one individual (id=1646). An example is given below. The individual may have been seen several times during one day at several different locations. When I try to convert the dataframe I get error message
>>
>> Error in as.ltraj(track_1646, date, id, burst, typeII = TRUE, slsp = c("remove", :
>> non unique dates for a given burst
>> Would somebody be able to help ?
>>
>> Thank you very much for your time.
>>
>> Juliane
>>
>>
>> X Y date id burst Time ID VR2number
>> -82.5632 27.303 18/08/2006 1646 1646 08:48:59 64 32
>> -82.5605 27.30237 18/08/2006 1646 1646 09:53:20 63 30
>> -82.5632 27.303 18/08/2006 1646 1646 13:27:48 121 32
>> -82.5737 27.31475 18/08/2006 1646 1646 20:39:18 91 33
>> -82.5445 27.27731 05/09/2006 1646 1646 22:17:52 3243 19
>> -82.5356 27.2716 05/09/2006 1646 1646 23:29:38 16319 20
>> -82.5445 27.27731 08/09/2006 1646 1646 23:34:30 3904 19
>> -82.5356 27.2716 09/09/2006 1646 1646 02:39:48 25023 20
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-ecology mailing list
>> R-sig-ecology at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>
>>
>>
>
> --
> Stéphane DRAY (dray at biomserv.univ-lyon1.fr )
> Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
> 43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
> Tel: 33 4 72 43 27 57 Fax: 33 4 72 43 13 88
> http://pbil.univ-lyon1.fr/members/dray/
>
>
>
--
Stéphane DRAY (dray at biomserv.univ-lyon1.fr )
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57 Fax: 33 4 72 43 13 88
http://pbil.univ-lyon1.fr/members/dray/
More information about the R-sig-ecology
mailing list