Skip to contents

Proportion of visits in which a species was detected (n_occupied / n_visits). Empty visits stay in the denominator. This is naive occupancy, not a detection-corrected model.

Usage

obs_frequency(
  x,
  by = "species",
  period = "month",
  location = NULL,
  user = NULL,
  species = NULL,
  group = NULL,
  protocol = NULL,
  date = NULL,
  date_start = NULL,
  date_end = NULL
)

Arguments

x

Path to a project SQLite export, a project obs_df, or a visit tibble from obs_visits().

by

Grouping besides species: "species" (default, overall), "location", "period", or a combination.

period

When by includes "period": "month" (default), "year", "week" (ISO) or "day".

location

Location id or name (partial match). Restricts effort.

user

Observer id or name. Restricts effort.

species

Scientific or common name (partial match). Restricts the reported taxa, not the visits.

group

Species group name. Restricts the reported taxa.

protocol

Protocol id or name. Restricts effort.

date

Length-2 vector c(start, end) as "YYYY-MM-DD", or a single date.

date_start, date_end

Bounds on visit.start_date.

Value

A tibble with n_visits, n_occupied and frequency.

Details

location, user, protocol and dates restrict the visit set (the effort). species and group restrict which taxa are reported; they do not drop visits without those taxa.

A visit counts as occupied when the species has at least one record with number missing or greater than zero. Records with number = 0 are absences.

When visit.counted is in the export, visits whose completeness does not allow a frequency analysis (counted other than s or i) emit a warning. They are still included. If the column is absent, nothing is warned.

Examples

if (FALSE) { # \dontrun{
obs_frequency("project-export.sqlite")
obs_frequency(db, by = "location")
obs_frequency(db, species = "Bufo bufo", by = "period")
} # }