Skip to contents

One row per sample, including samples with no observations. Attributes are pivoted to columns using the original export names. Nested observations are a list-column when nest = TRUE.

Usage

obs_samples(
  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 an observations list-column.

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 samples 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 sample.start_date (falling back to the visit date).

Value

A tibble, one row per sample.

Examples

if (FALSE) { # \dontrun{
obs_samples("project-export.sqlite")
obs_samples(db, protocol = "Pond check")
} # }