get_n_obs: Get number of observations for each deployment

View source: R/get_n_obs.R

get_n_obsR Documentation

Get number of observations for each deployment

Description

Gets the number of observations (of a subset of species) per deployment. The number of observations is defined as the number of distinct sequences (sequenceID).

Usage

get_n_obs(
  package = NULL,
  ...,
  species = "all",
  sex = NULL,
  life_stage = NULL,
  datapkg = lifecycle::deprecated()
)

Arguments

package

Camera trap data package object, as returned by read_camtrap_dp().

...

Filter predicates for filtering on deployments

species

Character with scientific names or common names (case insensitive). If "all" (default) all scientific names are automatically selected. If NULL all observations of all species are taken into account.

sex

Character defining the sex class to filter on, e.g. "female" or c("male", "unknown"). If NULL (default) all observations of all sex classes are taken into account.

life_stage

Character vector defining the life stage class to filter on, e.g. "adult" or c("subadult", "adult"). If NULL (default) all observations of all life stage classes are taken into account.

datapkg

Deprecated. Use package instead.

Value

A tibble data frame with the following columns:

  • deploymentID: Deployment unique identifier.

  • scientificName: Scientific name of the species. This column is omitted if parameter species = NULL.

  • n: Number of observations.

See Also

Other exploration functions: get_cam_op(), get_custom_effort(), get_effort(), get_n_individuals(), get_n_species(), get_rai(), get_rai_individuals(), get_record_table(), get_scientific_name(), get_species()

Examples

# Get number of observations for each species
get_n_obs(mica)

# Get number of obs of all species, not identified individuals as well
get_n_obs(mica, species = NULL)

# Get number of observations of Anas platyrhynchos (scientific name)
get_n_obs(mica, species = "Anas platyrhynchos")

# Get number of observations of eurasian beaver (vernacular names)
get_n_obs(mica, species = "eurasian beaver")

# Case insensitive
get_n_obs(mica, species = "Anas plaTYrhYnchoS")
get_n_obs(mica, species = "EUrasian beavER")

# Specify life stage
get_n_obs(mica, life_stage = "subadult")

# Specify sex
get_n_obs(mica, sex = "female")

# Specify both sex and life stage
get_n_obs(mica, sex = "unknown", life_stage = "adult")

# Applying filter(s), e.g. deployments with latitude >= 51.18
get_n_obs(mica, pred_gte("latitude", 51.18))

inbo/camtraptor documentation built on June 2, 2025, 5:17 a.m.