Skip to content

Commit

Permalink
Use only event based obs
Browse files Browse the repository at this point in the history
See #332.
  • Loading branch information
damianooldoni committed Nov 20, 2024
1 parent f89cf0b commit 4f81d23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/n_species.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#' only unidentified species, the number of identified species is set to 0. If a
#' deployment has no observations, the number of identified species is set to
#' `NA`.
#'
#' Only event-based observations (`observationLevel` = `event`) are taken into account.
#'
#' @inheritParams get_species
#' @return A tibble data frame with the following columns:
Expand All @@ -21,8 +23,9 @@ n_species <- function(x) {
# Check camera trap data package
camtrapdp::check_camtrapdp(x)

# Extract observations and deployments
observations <- observations(x)
# Extract event-based observations and deployments
observations <- observations(x) %>%
dplyr::filter(.data$observationLevel == "event")
deployments <- deployments(x)

# Get deployments without observations
Expand Down

0 comments on commit 4f81d23

Please sign in to comment.