
Set, create or modify columns with information of who made an observation
Source:R/set_observer.R
set_observer.Rd
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.
Arguments
- .df
A
data.frame
ortibble
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")
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
)
#> ⠙ Checking 1 column: recordedBy
#> ✔ Checking 1 column: recordedBy [310ms]
#>
#> # A tibble: 3 × 5
#> name latitude longitude eventDate recordedBy
#> <chr> <dbl> <dbl> <chr> <chr>
#> 1 Crinia Signifera -35.3 149. 2010-10-14 David Attenborough
#> 2 Crinia Signifera -35.2 149. 2010-10-14 David Attenborough
#> 3 Litoria peronii -35.8 149. 2010-10-14 David Attenborough