as.ltraj {adehabitat}R Documentation

Working with Trajectories in 2D Space: the Class ltraj

Description

The class ltraj is intended to store trajectories of animals monitored using telemetry (radio-tracking, GPS, Argos).
as.ltraj creates an object of this class.
summary.ltraj returns the number of relocations (and missing values) for each "burst" of relocations and each animal.
traj2ltraj, and the reciprocal function ltraj2traj respectively converts an object of class ltraj to an object of class traj, and conversely. rec recalculates the descriptive parameters of an object of class ltraj (e.g. after a modification of the contents of this object, see examples)

Usage

as.ltraj(xy, date, id, burst = id, slsp = c("remove", "missing"))
print.ltraj(x, ...)
summary.ltraj(object, ...)
traj2ltraj(traj, slsp =  c("remove", "missing"))
ltraj2traj(x)
rec(x, slsp = c("remove", "missing"))

Arguments

x, object an object of class ltraj
xy a data.frame containing the x and y coordinates of the relocations
date a vector of class POSIXct giving the date for each relocation
id either a character string indicating the identity of the animal or a factor with length equal to nrow(xy)
burst either a character string indicating the identity of the burst of relocations or a factor with length equal to nrow(xy)
slsp a character string used for the computation of the turning angles (see details)
traj an object of class traj
... For other functions, arguments to be passed to the generic functions summary and print

Details

Objects of class ltraj allow the analysis of animal movements. They contain the information generally used in such studies (angles, length of moves, increases in the x and y direction, etc., See below).

For a given individual, trajectories are often sampled as "bursts" of relocations (Dunn and Gipson, 1977). For example, when an animal is monitored using radio-tracking, the data may consist of several circuits of activity (two successive relocations on one circuit are often highly autocorrelated, but the data from two circuits may be sampled at long intervals in time). These bursts are indicated by the attribute burst. Note that the bursts should be unique: do not use the same burst id for bursts collected on different animals.

The computation of turning angles may be problematic when successive relocations are located at the same place. In such cases, at least one missing value is returned. For example, let r1, r2, r3 and r4 be 4 successive relocations of a given animal (with coordinates (x1,y1), (x2,y2), etc.). The turning angle in r2 is computed between the moves r1-r2 and r2-r3. If r2 = r3, then a missing value is returned for the turning angle at relocation r2. The argument slsp controls the value returned for relocation r3 in such cases. If slsp == "missing", a missing value is returned also for the relocation r3. If slsp == "remove", the turning angle computed in r3 is the angle between the moves r1-r2 and r3-r4.

In theory, it is expected that the time lag between two relocations is constant in all the bursts and all the ids of one object of class ltraj (don't mix animals located every 10 minutes and animals located every day in the same object). Nevertheless, This class allows for some negligible imprecision in the time of collection of the data (which may occur with some modes of data collection, e.g. with Argos collars).

Missing values are frequent in the trajectories of animals collected using telemetry, and are therefore allowed in objects of class ltraj. For example, GPS collar may not receive the signal of the satellite at the time of relocation. Most functions dealing with the class ltraj have a specified behavior in case of missing values.

Value

summary.ltraj returns a data frame.
ltraj2traj returns an object of class traj.
All other functions return objects of class ltraj. An object of class ltraj is a list with one component per burst of relocations. Each component is a data frame with two attributes: the attribute "id" indicates the identity of the animal, and the attribute "burst" indicates the identity of the burst. Each data frame stores the following columns:

x the x coordinate for each relocation
y the y coordinate for each relocation
date the date for each relocation
dx the increase of the move in the x direction. At least two successive relocations are needed to compute dx. Missing values are returned otherwise.
dy the increase of the move in the y direction. At least two successive relocations are needed to compute dy. Missing values are returned otherwise.
dist the length of each move. At least two successive relocations are needed to compute dist. Missing values are returned otherwise.
dt the time interval between successive relocations
R2n the squared net displacement between the current relocation and the first relocation of the trajectory
abs.angle the angle between each move and the x axis. At least two successive relocations are needed to compute abs.angle. Missing values are returned otherwise.
rel.angle the turning angles between successive moves. At least three successive relocations are needed to compute rel.angle. Missing values are returned otherwise.

Note

The class ltraj is a better alternative to the class traj. Indeed, the class ltraj already contains the basic information needed for the modelling of movement processes. In a close future, many functions will be added to adehabitat, allowing such a modelling.

Furthermore, note that the computation of the turning angles is faster with as.ltraj than with angles.

Author(s)

Clément Calenge calenge@biomserv.univ-lyon1.fr
Stéphane Dray dray@biomserv.univ-lyon1.fr

References

Dunn, J.E. and Gipson, P.S. (1977) Analysis of radio telemetry data in studies of home range. Biometrics. 59, 794–800.

See Also

c.ltraj to combine several objects of class ltraj, Extract.ltraj to extract or replace bursts of relocations, plot.ltraj for graphical displays, gdltraj to specify a time period. For further information on the class traj, see as.traj.

Examples


data(puechabon)
locs <- puechabon$locs
locs[1:4,]
xy <- locs[,c("X","Y")]

### Conversion of the date to the format POSIX
da <- as.character(locs$Date)
da <- as.POSIXct(strptime(as.character(locs$Date),"%y%m%d"))

### Creation of an object of class "ltraj", with for 
### example the first animal
(tr1 <- as.ltraj(xy[locs$Name=="Brock",],
                 date = da[locs$Name=="Brock"],
                 id="Brock"))

## The components of the object of class "ltraj"
head(tr1[[1]])

## With all animals
(litr <- as.ltraj(xy, da, id = locs$Name))

## Change something Manually in the first burst:
head(litr[[1]])
litr[[1]][3,"x"] <- 700000

## Recompute the trajectory
litr <- rec(litr)
## Note that descriptive statistics have changed (e.g. dx)
head(litr[[1]])


[Package adehabitat version 1.4-1 Index]