View source: R/get_detections.R
get_residents | R Documentation |
This function identifies ‘resident’ individuals in a passive acoustic telemetry array from acoustic detection time series.
get_residents(
acoustics,
fct = NULL,
resident_threshold_gap = 31,
resident_threshold_duration = c(91.2501, 365.25),
resident_labels = c("S", "L"),
non_resident_label = "N",
keep = NULL
)
acoustics |
A dataframe that contains passive acoustic telemetry detection time series (see |
fct |
(optional) A character that defines the name of a column in |
resident_threshold_gap |
A number that specifies the maximum gap (days) between detections for an individual to be considered ‘resident’ over the period of detections. |
resident_threshold_duration |
A sorted, numeric vector that specifies the duration (days) over which ‘regular’ detections (spaced less than |
resident_labels |
A character vector of labels, one for each |
non_resident_label |
A character that defines the label given to non-residents. |
keep |
A character vector of column names in |
This function assigns residency categories (e.g., non-resident, short-term resident, long-term resident) to individuals in acoustics
, returning a dataframe with one row for each individual and a column for assigned residency categories. ‘Resident’ individuals are defined as individuals with (a) ‘regular’ detections (i.e. detections spaced less than some threshold time (resident_threshold_duration
) apart) that (b) last for a requisite time interval (resident_threshold_duration
). Multiple residency categories can be specified. Under the default options, non-residents are labelled "N"
. Short-term residents (labelled "S"
) are defined as individuals for which sequential detections were less than 31 days apart for more than 91 days (three months). Long-term residents (labelled "L"
) are defined as individuals for which sequential detections were less than 31 days apart for more than 365 days (12 months).
A method
argument may be added in due course to implement other methods to define ‘resident’ individuals (e.g., based on detection days, see get_detection_days
) .
The function returns a dataframe that defines, for each individual (fct
), the duration (days) between the first detection and the last detection in a series of detections spaced less than resident_threshold_gap
days apart (‘time’), and the residency category (as defined by resident_threshold_duration
and resident_labels
).
Edward Lavender
Lavender, et al. (in 2021). Movement patterns of a Critically Endangered elasmobranch (Dipturus intermedius) in a Marine Protected Area. Aquatic Conservation: Marine and Freshwater Ecosystems, 32(2), 348–365. https://doi.org/10.1002/aqc.3753
get_detection_days
, get_detection_clumps
#### Example (1): Implement default options
get_residents(dat_acoustics, fct = "individual_id")
# Compare results to abacus plot
prettyGraphics::pretty_plot(dat_acoustics$timestamp, dat_acoustics$individual_id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.