set_observer: Set, create or modify columns with information of who made an...

View source: R/set_observer.R

set_observerR Documentation

Set, create or modify columns with information of who made an observation

Description

Format fields that contain information about who made a specific observation of an organism to a tibble using Darwin Core Standard.

In practice this is no different from using mutate(), but gives some informative errors, and serves as a useful lookup for fields in the Darwin Core Standard.

Usage

set_observer(.df, recordedBy = NULL, recordedByID = NULL, .keep = "unused")

Arguments

.df

A data.frame or tibble that the column should be appended to.

recordedBy

Names of people, groups, or organizations responsible for recording the original occurrence. The primary collector or observer should be listed first.

recordedByID

The globally unique identifier for the person, people, groups, or organizations responsible for recording the original occurrence.

.keep

Control which columns from .data are retained in the output. Note that unlike dplyr::mutate(), which defaults to "all" this defaults to "unused"; i.e. only keeps Darwin Core columns, and not those columns used to generate them.

Details

Examples of recordedBy values:

  • ⁠José E. Crespo⁠

Examples of recordedByID values:

  • c("https://orcid.org/0000-0002-1825-0097", "https://orcid.org/0000-0002-1825-0098")

Value

A tibble with the requested fields added/reformatted.

Examples

df <- tibble::tibble(
  name = c("Crinia Signifera", "Crinia Signifera", "Litoria peronii"),
  latitude = c(-35.27, -35.24, -35.83),
  longitude = c(149.33, 149.34, 149.34),
  eventDate = c("2010-10-14", "2010-10-14", "2010-10-14"),
  observer = c("David Attenborough", "David Attenborough", "David Attenborough")
  )

# Reformat columns to Darwin Core terms
df |>
  set_observer(
    recordedBy = observer
    )


corella documentation built on April 4, 2025, 12:20 a.m.