[R-sig-eco] Strange calculation of dt in adehabitat
Anders Kagervall
Anders.Kagervall at vfm.slu.se
Thu Jul 8 17:42:47 CEST 2010
Hi,
I have just started to use adehabitat have maybe stumbled on bug in the calculation of dt in as.ltraj I have GPS data sampled in reasonable regular interval. In this case the interval should be near 1800 seconds.
What I don't understand is how dt for relocation number 6 can be 5471 seconds. Is it a bug or is there something that I don't understand here? Any input appreciated.
Demo data and code:
> library(adehabitat)
> points <- read.csv("points.txt",header=T) points$LMT_Date <-
> as.POSIXct(points$LMT_Date) points
Object_ID X Y LMT_Date
1 aa_ac_05_115 1498706 7387365 2008-10-26 00:00:41
2 aa_ac_05_115 1498711 7387367 2008-10-26 00:30:12
3 aa_ac_05_115 1498708 7387367 2008-10-26 01:00:48
4 aa_ac_05_115 1498707 7387366 2008-10-26 01:30:12
5 aa_ac_05_115 1498707 7387365 2008-10-26 02:00:16
6 aa_ac_05_115 1498708 7387367 2008-10-26 02:30:12
7 aa_ac_05_115 1498711 7387376 2008-10-26 03:01:23
8 aa_ac_05_115 1498712 7387419 2008-10-26 03:30:14
9 aa_ac_05_115 1498724 7387618 2008-10-26 04:00:17 10 aa_ac_05_115 1498723 7387624 2008-10-26 04:30:23
> tr <- as.ltraj( points[,c("X","Y")], date = points$LMT_Date, id =
> points$Object_ID) tr
*********** List of class ltraj ***********
Type of the traject: Type II (time recorded) Irregular traject. Variable time lag between two locs
Characteristics of the bursts:
id burst nb.reloc NAs date.begin date.end
1 aa_ac_05_115 aa_ac_05_115 10 0 2008-10-26 00:00:41 2008-10-26 04:30:23
> tr[[1]]
x y date dx dy dist dt R2n abs.angle rel.angle
1 1498706 7387365 2008-10-26 00:00:41 4.9607648100 2.20537155 5.428890 1771 0.000000 0.4183232 NA
2 1498711 7387367 2008-10-26 00:30:12 -3.5757074798 -0.09854094 3.577065 1836 29.472851 -3.1140412 2.75082096
3 1498708 7387367 2008-10-26 01:00:48 -0.9629397001 -0.54593210 1.106930 1764 6.357119 -2.6258344 0.48820682
4 1498707 7387366 2008-10-26 01:30:12 -0.0005537099 -1.19318821 1.193188 1804 2.614587 -1.5712604 1.05457398
5 1498707 7387365 2008-10-26 02:00:16 0.9633071600 1.33767369 1.648433 1796 0.312927 0.9466836 2.51794401
6 1498708 7387367 2008-10-26 02:30:12 3.2656030301 9.80078719 10.330518 5471 4.826202 1.2491675 0.30248392
7 1498711 7387376 2008-10-26 03:01:23 1.2939203100 42.65423967 42.673861 1731 154.018885 1.5404705 0.29130299
8 1498712 7387419 2008-10-26 03:30:14 12.1896293599 198.91718789 199.290328 1803 2968.685928 1.5095929 -0.03087759
9 1498724 7387618 2008-10-26 04:00:17 -1.3766610399 6.23432703 6.384515 1806 64377.113802 1.7881282 0.27853523
10 1498723 7387624 2008-10-26 04:30:23 NA NA NA NA 67523.484052 NA NA
>
>
More information about the R-sig-ecology
mailing list