View source: R/set_occurrences.R
| set_occurrences | R Documentation | 
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.
set_occurrences(
  .df,
  occurrenceID = NULL,
  basisOfRecord = NULL,
  occurrenceStatus = NULL,
  .keep = "unused",
  .keep_composite = "all",
  .messages = TRUE
)
.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   | 
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"
A tibble with the requested columns added/reformatted.
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.
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"
    )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.