The class traj
is intended to explore trajects of
animals monitored using radio-tracking.
as.traj
creates an object of this class.
summary.traj
returns the number of relocations for each "burst"
of relocations and each animal.
plot.traj
allows various graphical displays of the
trajects.
getburst
returns an object of class traj
satisfying the
specified criteria (selection of one focus animal, of a period of interest,
of special "bursts" (see details)).
traj2df
, and the reciprocal function df2traj
respectively converts an object of class traj
to an object of
class data.frame
, and conversely.
as.traj(id, xy, date, burst = id, ...)
# S3 method for traj
print(x, ...)
# S3 method for traj
summary(object, id = levels(object$id), date = NULL, …)
# S3 method for traj
plot(x, id = levels(x$id), burst = levels(x$burst), date = NULL,
asc = NULL, area = NULL,
xlim = range(x$x), ylim = range(x$y),
colasc = gray((256:1)/256), colpol = "green",
addpoints = TRUE, addlines = TRUE,
perani = TRUE, final = TRUE, …)
getburst(x, burst = levels(x$burst),
id = levels(x$id), date = NULL)
traj2df(x)
df2traj(df)
a factor or a character vector giving for each relocation the
identity of the individual monitored in as.traj
.
a character vector containing the identity of the
individuals of interest in other functions
a data frame with 2 columns containing the x and y coordinates of the relocations
a vector of class POSIXct
giving the date for each relocation in as.traj
.
a vector of class POSIXct
with length 2, indicating the
beginning and the end of the period of interest in other
functions
a factor or a character vector giving the identity of each
"burst" of relocations in as.traj
(e.g. the circuit id, see
details). The burst level needs to be unique (two animals cannot
have the same burst levels).
a character vector containing the burst levels of interest in
plot.traj
and getburst
an object of class traj
an object of class traj
an object of class asc
an object of class area
(see help(area)
)
the ranges to be encompassed by the x axis
the ranges to be encompassed by the y axis
a character vector giving the colors of the
map of class asc
a character vector giving the colors of the
polygon contour map, when area
is not NULL
logical. If TRUE
, lines joining consecutive
relocations are drawn
logical. If TRUE
, points corresponding to
each relocation are drawn
logical. If TRUE
, one plot is drawn for each
level of the factor id
, and for a given animal, the several
bursts are superposed on the same plot. If FALSE
, one plot
is drawn for each level of the factor burst
logical. If TRUE
, the initial and final
relocations of each burst are indicated in blue and red, respectively
a data frame to be converted to the class traj
other optional vectors containing some variables measured at
each relocation (e.g. temperature, wind,
elevation, etc.) in as.traj
.
For other functions, arguments to be passed to
the generic functions plot
, summary
and print
An object of class traj
is a data frame with one column
named id
, one column named x
, one column named y
,
one column named date
and one column named burst
. This
class therefore inherits from the class data.frame
.
For a given individual, trajects 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 factor burst
.
Dunn, J.E. and Gipson, P.S. (1977) Analysis of radio telemetry data in studies of home range. Biometrics. 59, 794--800.
as.POSIXct
and strptime
for
additional information of the class POSIX
.
# NOT RUN {
data(puechabon)
locs <- puechabon$locs
locs[1:4,]
### 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 the object of class "traj"
(tr <- as.traj(id = locs$Name, xy = locs[,c("X", "Y")],
date = da))
summary(tr)
plot(tr)
### Displays on maps of the study area
k <- puechabon$kasc
ele <- getkasc(k, "Elevation")
plot(tr, asc = ele)
# }
Run the code above in your browser using DataLab