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 class 'traj':
print(x, ...)
## S3 method for class 'traj':
summary(object, id = levels(object$id), date = NULL, ...)
## S3 method for class '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)
as.traj
.
a character vector containing the identity of the
individuals of interest in other functionsPOSIXct
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
functionsas.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 vetraj
traj
asc
area
(see help(area)
)asc
area
is not NULL
TRUE
, lines joining consecutive
relocations are drawnTRUE
, points corresponding to
each relocation are drawnTRUE
, 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 TRUE
, the initial and final
relocations of each burst are indicated in blue and red, respectivelytraj
as.traj
.
For other functions, arguments to be passed to
the generic functions plot
, su
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
.burst
.as.POSIXct
and strptime
for
additional information of the class POSIX
.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