get_rai: Get Relative Abundance Index (RAI)

View source: R/get_rai.R

get_raiR Documentation

Get Relative Abundance Index (RAI)

Description

Gets the RAI (Relative Abundance Index) per deployment. The RAI is normalized using 100 days deployment activity. In other words: RAI = 100 * (n/effort) where n is the number of observations as calculated via get_n_obs() and effort is the effort in days as calculated via get_effort().

Usage

get_rai(
  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.

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.

  • rai: Relative abundance index.

See Also

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

Examples

# Calculate RAI for all species
get_rai(mica) # species = "all" by default, so equivalent of
get_rai(mica, species = "all")

# Selected species
get_rai(mica, species = c("Anas platyrhynchos", "Martes foina"))

# With vernacular names, even mixing languages
get_rai(mica, species = c("mallard", "steenmarter"))

# Mixed scientific and vernacular names
get_rai(mica, species = c("Anas platyrhynchos", "steenmarter"))

# Species parameter is case insensitive
get_rai(mica, species = c("ANAS plAtyRhynChOS"))

# Specify sex
get_rai(mica, sex = "female")
get_rai(mica, sex = c("female", "unknown"))

# Specify life stage
get_rai(mica, life_stage = "adult")
get_rai(mica, life_stage = c("adult", "subadult"))

# Apply filter(s): deployments with latitude >= 51.18
get_rai(mica, pred_gte("latitude", 51.18))

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