Transforms a Camera Trap Data Package object to a Darwin Core Archive.
Arguments
- x
Camera Trap Data Package object, as returned by
read_camtrapdp().- directory
Path to local directory to write files to.
Value
CSV and meta.xml files written to disk.
And invisibly, a list of data frames with the transformed data.
Transformation details
This function follows recommendations in Reyserhove et al. (2023) doi:10.35035/doc-0qzp-2x37 and transform data to:
An Occurrence core.
A
meta.xmlfile.
Key features of the Darwin Core transformation:
The Occurrence core contains one row per observation (
dwc:occurrenceID = observationID).Only observations with
observationType = "animal"and are included, thus excluding observations that are (of) humans, vehicles, blanks, unknowns and unclassified.Either observations with
observationLevel = "event"or"media"are used, never both to avoid duplicates. The level be defined withx$gbifIngestion$observationLevel, with"event"as default.Observations classified by humans with 100% certainty get a
dwc:identificationVerificationStatus = "verified using recorded media".Deployment information is included in the Occurrence core, such as location, habitat,
dwc:samplingProtocol, deployment duration indwc:samplingEffortanddwc:parentEventID = deploymentIDas grouping identifier.Event information is included in the Occurrence core, as event duration in
dwc:eventDateanddwc:eventID = eventIDas grouping identifier.Media files are included in the Audubon/Audiovisual Media Description extension, with a foreign key to the observation. A media file that is used for more than one observation is repeated.
Metadata are used to set the following record-level terms:
dwc:datasetID:x$id.dwc:datasetName:x$title.dwc:collectionCode: first source inx$sources.dcterms:license: licensename(e.g.CC0-1.0) inx$licenseswith scopedata. The licensenamewith scopemediais used asdcterms:rightsin the Audubon Media Description extension.dcterms:rightsHolder: first contributor inx$contributorswith rolerightsHolder.dwc:dataGeneralizations: set ifx$coordinatePrecisionis defined.
See also
Other transformation functions:
merge_camtrapdp(),
round_coordinates(),
shift_time(),
update_taxon(),
write_eml()
Examples
x <- example_dataset()
write_dwc(x, directory = "my_directory")
#>
#> ── Transforming data to Darwin Core (event-based observations) ──
#>
#> ── Writing files ──
#>
#> • my_directory/occurrence.csv
#> • my_directory/multimedia.csv
#> • my_directory/meta.xml
# Clean up (don't do this if you want to keep your files)
unlink("my_directory", recursive = TRUE)