Skip to contents

One row per visit, including visits with no samples. Attributes are pivoted to columns using the original attribute names from the export. Nested samples (and their observations) are a list-column when nest = TRUE. If the export has visit.counted, it is returned as counted.

Usage

obs_visits(
  x,
  nest = TRUE,
  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, or a project obs_df.

nest

If TRUE (default), add a samples list-column. If FALSE, return the visit table with counts only.

location

Location id or name (partial match).

user

Observer id (observer_code) or name when present in user.

species

Scientific or common name (partial match). Restricts to visits with at least one matching observation.

group

Species group name ("Birds", "Aves").

protocol

Protocol id or name.

date

Length-2 vector c(start, end) as "YYYY-MM-DD", or a single date. Overrides date_start / date_end when supplied.

date_start, date_end

Bounds on visit.start_date.

Value

A tibble, one row per visit.

Details

species / group keep visits that contain at least one matching observation and drop the rest. location, user, protocol and dates keep empty visits that still match.

Examples

if (FALSE) { # \dontrun{
obs_visits("project-export.sqlite", location = "North Ridge")
obs_visits(db, user = 101, nest = FALSE)
obs_visits(db, species = "Bufo bufo")
} # }