Splitting a trajectory may be of interest in many situations. For
example, if it is known that two kinds of activities of the monitored
animals correspond to different properties of, say, the distance
between successive relocations, it may be of interest to split the
trajectory according to the values of these distances.
The criterion used to cut the trajectory may imply any of the
parameters describing a trajectory in the object ltraj
(e.g.,
"dt"
, "dist"
, "dx"
, etc. see the help page of
as.ltraj
), as well as any variable stored in the attribute
"infolocs"
of the object.
Two options are available in cutltraj
, depending on the value
of nextr
. If nextr = FALSE
, any sequence of
successive relocations that *do not* match the criterion is considered
as a new burst. For example, if for a given burst, the criterion
returns the vector (FALSE, FALSE, FALSE, TRUE, TRUE, TRUE,
FALSE, FALSE, FALSE)
, then the function cutltraj
creates
two new bursts of relocations, the first one containing the first 3
relocations and the second one the last 3 relocations.
If nextr = TRUE
, any sequence of successive relocations that
*do not* match the criterion, *as well as the first relocation that
does match it after this sequence* is considered as a new burst.
This option is available because many of the descriptive parameters
associated to a given relocation in an object of class ltraj
measure some specific feature concerning the position of the next
relocation. For example, one may want to consider as a burst any
sequence of relocations for which the time lag is below one hour (the
criterion is "dt > 3600"
. The first relocation for which this
criterion is TRUE belong to the burst, and it is the next one which
is excluded from the burst. For example, if for a given burst, the
criterion returns the vector (FALSE, FALSE, FALSE, TRUE, TRUE,
TRUE, FALSE, FALSE, FALSE)
, then the function cutltraj
creates two new bursts of relocations, the first one containing the
first 4 relocations and the second one the last 3 relocations.