get_annotation_completeness
get_annotation_completeness.RdScreen Data Package for Demographic Annotation Coverage.
Identifies time periods and deployment windows where demographic attributes
(lifeStage, sex, or custom fields) are actively annotated (non-NA).
Arguments
- package
Camera trap data package object (as returned by
read_camtrap_dp()).- fields
Character vector of column names in
package$data$observationsto evaluate. Defaults toc("lifeStage", "sex").- mode
Character string (
"any"or"all")."any"flags observations where at least one field is annotated;"all"requires all specified fields to be non-NA. Defaults to"any".- species
Scientific or vernacular species name(s) to filter on. Defaults to
"all".- by
Character vector of column name(s) in
package$data$deploymentsto group by (e.g.,"deploymentID","locationName"). Use"all"orNULLto screen the entire dataset. Defaults to"deploymentID".
Value
A tibble detailing observation counts, percentage annotated, first and last annotated timestamps, and total annotated duration (in days) per group.
Examples
if (FALSE) { # \dontrun{
# Data paths
zipfile <- "../fis-grofwild/Projecten/Drongengoed/Input/Agouti/drongengoed.zip"
exdir <- "../fis-grofwild/Projecten/Drongengoed/Input/Agouti/filesDRG"
# Download and unzip files
download_gdrive_if_missing("1F7mCj-Wm0Ggq1evz1HusxZBgX-1ttx-S", destfile = zipfile)
unzip(zipfile, exdir = exdir)
# Import as Camtrap DP
drg <- camtraptor::read_camtrap_dp(file.path(exdir, "datapackage.json"))
# Check deployments where EITHER lifeStage OR sex is annotated
drg$data$deployments <- drg$data$deployments %>%
mutate(year = year(start), month = month(start),
year_month = floor_date(start, unit = "month"))
coverage_dep <- get_annotation_completeness(
package = drg,
fields = c("lifeStage", "sex"),
mode = "any",
species = "Capreolus capreolus",
by = "year_month"
)
} # }