set_occurrences {corella} | R Documentation |
Set, create or modify columns with occurrence-specific information
Description
Format fields uniquely identify each occurrence record and specify the type
of record. occurrenceID
and basisOfRecord
are necessary fields of
information for occurrence records, and should be appended to a data set
to conform to Darwin Core Standard prior to submission.
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_occurrences(
.df,
occurrenceID = NULL,
basisOfRecord = NULL,
occurrenceStatus = NULL,
.keep = "unused",
.keep_composite = "all",
.messages = TRUE
)
Arguments
.df |
a |
occurrenceID |
A character string. Every occurrence should have an
|
basisOfRecord |
Record type. Only accepts
|
occurrenceStatus |
Either |
.keep |
Control which columns from |
.keep_composite |
Control which columns from |
.messages |
Logical: Should progress message be shown? Defaults to |
Details
Examples of occurrenceID
values:
-
000866d2-c177-4648-a200-ead4007051b9
-
http://arctos.database.museum/guid/MSB:Mamm:233627
Accepted basisOfRecord
values are one of:
-
"humanObservation"
,"machineObservation"
,"livingSpecimen"
,"preservedSpecimen"
,"fossilSpecimen"
,"materialCitation"
Value
A tibble
with the requested columns added/reformatted.
See Also
basisOfRecord_values()
for accepted values for the basisOfRecord
field'; random_id()
, composite_id()
or sequential_id()
for formatting
ID columns; set_abundance()
for occurrence-level counts.
Examples
df <- tibble::tibble(
scientificName = 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")
)
# Add occurrence information
df |>
set_occurrences(
occurrenceID = composite_id(random_id(), eventDate), # add composite ID
basisOfRecord = "humanObservation"
)