When creating a Darwin Core archive, it is often useful to select only those
fields that conform to the standard. These functions provide a vector of
terms that can be used in combination with dplyr::select()
and
dplyr::any_of()
to quickly select Darwin Core terms for the relevant
data type (events, occurrences, media).
See also
basisOfRecord_values()
or countryCode_values()
for valid entries
within a field.
Examples
# Return a vector of accepted terms in an Occurrence-based dataset
occurrence_terms() |> head(10L) # first 10 terms
#> [1] "type" "modified" "language"
#> [4] "license" "rightsHolder" "accessRights"
#> [7] "bibliographicCitation" "references" "institutionID"
#> [10] "collectionID"
# Use this vector to filter a data frame
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"),
measurement1 = c(24.3, 24.9, 20.1), # example measurement column
measurement2 = c(0.92, 1.03, 1.09) # example measurement column
)
df |>
dplyr::select(any_of(occurrence_terms()))
#> # A tibble: 3 × 1
#> eventDate
#> <chr>
#> 1 2010-10-14
#> 2 2010-10-14
#> 3 2010-10-14