Description Usage Arguments Details Value See Also Examples
Computes the duration of encounters between each pair of groups over the whole
measurement period of a trajectory. The user can select what movement model(s)
to apply and whether the result should be on the level of bursts or IDs.
encounterDurationById
returns the duration of encounters for each pair of
IDs, given the duration of encounters for each pair of bursts. This allows to
obtain both types of result without recomputing everything.
1 2 | encounterDuration(tr, threshold, model = c("BBMM", "linear"), byburst = FALSE, timestepSize = 60)
encounterDurationById(encounterDurationByBurst)
|
tr |
The trajectory to analyze |
threshold |
The maximum distance at which an encounter is detected |
model |
The movement models for which to compute the encounter duration |
byburst |
If |
timestepSize |
If a movement model requires numerical integration in the time dimension, this is the size of each time step. |
encounterDurationByBurst |
The result of calling |
Since the duration of encounters is a random variable in the Brownian bridge movement model, this function cannot give exact results there. Instead, it reports the expected duration of encounters in the BBMM.
If you already have the encounter duration between bursts and you also want the
encounter duration between IDs, you should use encounterDurationById
instead of calling encounterDuration
again with different parameters. They
give identical results, but the former is much faster since it does not recompute
all relevant durations.
If byburst == FALSE
, the result is a data.frame
with one row
for each interesting pair of bursts. A pair of bursts is interesting if they
overlap in time, since otherwise the duration is always zero.
The result contains the following fields:
id1,id2 |
The IDs of the bursts involved |
burst1,burst2 |
The names of the bursts involved |
|
In addition there is one column for each model requested, named after
the model. These columns are of type |
If byburst == TRUE
, the result is a 3 dimensional array, indexed by
the two IDs and the movement model. The entries in the array are again of class
difftime
with unit secs
.
1 2 3 4 5 6 7 8 9 | data("vervet_monkeys", package="moveBB")
#ed <- encounterDuration(monkey.tr, 100, byburst=TRUE)
#barplot(ed)
#barplot(encounterDurationById(ed))
# This one has the same result, but needs to recompute everything
#barplot(encounterDuration(monkey.tr, 100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.