residenceTime: Trajectory Analysis using the Residence Time Method

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/residenceTime.r

Description

These functions can be used to apply the residence time method (Barraquand and Benhamou, 2008).

Usage

1
2
3
4
5
6
7
8
residenceTime(lt, radius, maxt, addinfo = FALSE,
              units = c("seconds", "hours", "days"))

## S3 method for class 'resiti'
print(x, ...)

## S3 method for class 'resiti'
plot(x, addpoints = FALSE, addlines = TRUE, ...)

Arguments

lt

an object of class ltraj

radius

the radius of the patch (in units of the coordinates)

maxt

maximum time threshold that the animal is allowed to spend outside the patch before that we consider that the animal actually left the patch (see Details)

addinfo

logical value. If TRUE, then the residence time method is added as a variable in the infolocs component of the object lt. If FALSE this function returns an object of class resiti

units

a character string indicating the time units of maxt

x

an object of class "resiti"

addpoints

logical. Whether points should be added to the plot.

addlines

logical. Whether lines should be added to the plot.

...

additionnal arguments to be passed to or from other methods

Details

Barraquand and Benhamou (2008) proposed a new approach to identify the places where the animals spend the most of their time, relying on the calculation of their residence time in the various places where they have been relocated. This approach is similar to the first passage time method: for a given value of radius and for a given relocation, the first passage time is defined as the time required by the animal to pass through a circle of given radius centred on the relocation (see the help page of the function fpt for additional details). The residence time associated to a given relocation corresponds to the first passage time calculated at this place plus the passage times that occurred in this circle before or after the current relocation, *given* that the animal did not spent a time greater than maxt before reentering the circle (see Barraquand and Benhamou, 2008, for details). It is therefore computed by determining the various times at which the path intersects the perimeter of the circle centred on the current relocation, both forward and backward, and then by summing the durations associated with the various portions of the path occurring within the circle. The graphical examination of the changes with time allow to identify the dates and places where the animal spent most of its time.

A partitionning method can be used to segment the series formed by the residence time into homogeneous segments. Barraquand and Benhamou (2008) propose the method of Lavielle (1999, 2005). See the function lavielle for details about this method.

Value

If addinfo = FALSE, the function residenceTime returns a list of class "resiti" where each element corresponds to a burst of the object lt. Each element is a data.frame with two columns: the date and the residence time associated with the date.

Author(s)

Clement Calenge clement.calenge@ofb.gouv.fr

References

Barraquand, F. and Benhamou, S. (2008) Animal movement in heterogeneous landscapes: identifying profitable places and homogeneous movement bouts. Ecology, 89, 3336–3348.

See Also

lavielle for the partitionning of the trajectory based on the residence time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
## Not run: 
data(albatross)
ltr <- albatross[1]

## show the distances between successive relocations as a function
## of date
plotltr(ltr)

## focus on the first period
ltr <- gdltraj(ltr, as.POSIXct("2001-12-15", tz="UTC"),
               as.POSIXct("2003-01-10", tz="UTC"))

plot(ltr)
## We identify places that seem to be a patch and, with locator,
## we measure approximately their size.
## The approximate patch radius can be set equal to 100 km as a first try

plotltr(ltr, "dt")
## As a first try, we could set maxt equal to 15000 seconds, i.e.
## approximately 4 hours

## calculation of the residence time
res <- residenceTime(ltr, radius = 100000, maxt=4, units="hour")
plot(res)

## There seems to be about 10 segments. Let us try the method
## of Lavielle (1999, 2005) to segment this series:
## First calculate again the residence time as the infolocs attribute
## of the trajectory
res <- residenceTime(ltr, radius = 100000, maxt=4, addinfo = TRUE, units="hour")
res

## Note that the residence time is now an attribute of the infolocs
## component of res


## Now, use the Lavielle method, with Kmax set to 2-3 times the
## "optimal" number of segments, assessed visually according
## to the recommendations of Barraquand and Benhamou (2008)
## We set the minimum number of relocations in each segment to
## 10 observations (given that the relocations were theoretically
## taken every hour, this defines a patch as a place where the animal
## stays at least 10 hours: this also defines the scale of our study)

ii <- lavielle(res, which="RT.100000", Kmax=20, Lmin=10)

## Both the graphical method and the automated method to choose
## the optimal number of segments indicate 4 segments
## (see ?lavielle for a description of these methods):

chooseseg(ii)

## We identify the 4 segments: the method of Lavielle seems to do a good
## job:
(pa <- findpath(ii, 4))

## and we plot this partition:
plot(pa, perani=FALSE)


## Now, we could try a study at a smaller scale (patch = 50km):
res <- residenceTime(ltr, radius = 50000, maxt=4, addinfo = TRUE,
                     units="hour")
ii <- lavielle(res, which="RT.50000", Kmax=20, Lmin=10)

## 5 segments seem a good choice:
chooseseg(ii)

## There is more noise in the residence time, but
## the partition is still pretty clear:
(pa <- findpath(ii, 5))

## show the partition:
plot(pa, perani = FALSE)


## Now try at a larger scale (patch size=250 km)
res <- residenceTime(ltr, radius = 250000, maxt=4, addinfo = TRUE,
                     units="hour")
ii <- lavielle(res, which="RT.250000", Kmax=15, Lmin=10)

## 5 segments seem a good choice again:
chooseseg(ii)

## There is more noise in the residence time, but
## the partition is still pretty clear:
(pa <- findpath(ii, 5))

## show the partition:
plot(pa, perani = FALSE)


## End(Not run)

Example output

Loading required package: sp
Loading required package: ade4
Loading required package: adehabitatMA
Loading required package: CircStats
Loading required package: MASS
Loading required package: boot

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
* Time zone: UTC *
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
             id         burst nb.reloc NAs          date.begin
1  balise.11378  balise.11378      242   0 2002-12-26 15:12:59
             date.end
1 2003-01-08 02:55:57


 infolocs provided. The following variables are available:
[1] "RT.100000"
    K            D        Jk
1   1          Inf 227.00000
2   2  2.609436974 163.04983
3   3  0.715745703 125.11387
4   4  0.502890431  94.31339
5   5  1.382295448  68.52636
6   6  0.310696965  56.51982
7   7  0.400079872  47.61071
8   8  0.198021300  42.69011
9   9  0.202869254  39.74364
10 10  0.042228674  38.81963
11 11  0.019653092  38.31661
12 12 -0.019653092  38.00952
13 13  0.031079646  37.50650
14 14 -0.026755731  37.31332
15 15  0.029708977  36.85341
16 16  0.011630815  36.68967
17 17  0.004705056  36.64189
18 18  0.025883084  36.64101
19 19  0.042963130  36.89817

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
* Time zone: UTC *
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
             id     burst nb.reloc NAs          date.begin            date.end
1  balise.11378 Segment.1       34   0 2002-12-26 15:12:59 2002-12-28 09:55:34
2  balise.11378 Segment.2       36   0 2002-12-28 11:37:26 2002-12-29 21:16:38
3  balise.11378 Segment.3       59   0 2002-12-29 23:49:17 2003-01-02 22:11:19
4  balise.11378 Segment.4      113   0 2003-01-03 03:13:40 2003-01-08 02:55:57


 infolocs provided. The following variables are available:
[1] "RT.100000"
    K            D        Jk
1   1          Inf 239.00000
2   2  7.218265259 147.00398
3   3 -1.016442717 127.25206
4   4  1.232745760  97.32706
5   5  1.415183948  79.74001
6   6 -0.713475381  76.31685
7   7  0.630038584  65.75286
8   8 -0.029176398  61.49462
9   9  0.152301894  56.94437
10 10  0.186568831  53.91843
11 11  0.032912333  52.75977
12 12  0.013329118  51.93051
13 13  0.017304712  51.23466
14 14  0.010458256  50.71201
15 15  0.002094756  50.29402
16 16  0.004925788  49.89700
17 17  0.006116489  49.54928
18 18 -0.006116489  49.26278
19 19  0.027068151  48.91506

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
* Time zone: UTC *
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
             id     burst nb.reloc NAs          date.begin            date.end
1  balise.11378 Segment.1       11   0 2002-12-26 15:12:59 2002-12-27 04:20:02
2  balise.11378 Segment.2       20   0 2002-12-27 04:22:45 2002-12-28 05:42:23
3  balise.11378 Segment.3       39   0 2002-12-28 07:23:36 2002-12-29 21:16:38
4  balise.11378 Segment.4       16   0 2002-12-29 23:49:17 2002-12-30 23:02:48
5  balise.11378 Segment.5      156   0 2002-12-30 23:08:14 2003-01-08 02:55:57


 infolocs provided. The following variables are available:
[1] "RT.50000"
    K             D        Jk
1   1           Inf 188.00000
2   2  2.3179871255 119.62239
3   3  1.0916811332  79.46792
4   4  0.9751488494  52.60545
5   5  0.5465223441  37.61609
6   6  0.4898441413  29.28104
7   7 -0.2488483584  26.91019
8   8  0.3098796595  21.50943
9   9  0.0690243318  19.88167
10 10  0.0089499823  19.09434
11 11  0.0049167056  18.41597
12 12  0.0415248419  17.79748
13 13  0.0030096283  17.68457
14 14  0.0006591904  17.60831

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
* Time zone: UTC *
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
             id     burst nb.reloc NAs          date.begin            date.end
1  balise.11378 Segment.1       62   0 2002-12-26 15:12:59 2002-12-29 13:36:57
2  balise.11378 Segment.2       25   0 2002-12-29 15:10:28 2002-12-30 23:08:14
3  balise.11378 Segment.3       44   0 2002-12-30 23:25:13 2003-01-03 03:26:01
4  balise.11378 Segment.4       79   0 2003-01-03 03:45:59 2003-01-06 08:06:04
5  balise.11378 Segment.5       32   0 2003-01-06 11:39:21 2003-01-08 02:55:57


 infolocs provided. The following variables are available:
[1] "RT.250000"

adehabitatLT documentation built on Jan. 20, 2020, 1:13 a.m.