View source: R/fidelity_funs_calculate-returns.R
calc_ret_track | R Documentation |
Function to calculate returns for a single track. Called by
calc_returns()
.
calc_ret_track(t, dist, lag, window = Inf)
t |
Data frame of a single movement track (e.g., output from
|
dist |
Numeric. Maximum distance to be considered a return. Unit should match the unit of the coordinates: m if UTM, degrees if lat/long. |
lag |
Numeric. Vector of fidelity lags (unit is locations, e.g., 42 for one week at 6h resolution). See Details for definition of fidelity lag. |
window |
# Duration of the fidelity window ( |
Returns the original track with one additional column for each lag
indicating whether the location is a return (1) or not (0). Locations outside
the fidelity window are assigned NA
.
#' @details The fidelity lag defines what are considered "non-consecutive"
visits: a visit within distance dist
of a previously visited location
is non-consecutive if it occurs at least lag
days after the latest
visit at that location.
The fidelity window encompasses the range of eligible steps for returns to a
location. For a location visited at time T, the fidelity window includes
steps from time T - lag
- window
to time T - lag
.
Steps from T - lag
+ 1 to T are outside the fidelity window and any
revisitations within that period are not counted as returns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.