merge_camtrapdp {camtrapdp} | R Documentation |
Merge two Camera Trap Data Packages
Description
Merges two Camera Trap Data Package objects into one. Repeat to merge multiple datasets.
Usage
merge_camtrapdp(x, y)
Arguments
x , y |
Camera Trap Data Package objects, as returned by
|
Value
A single Camera Trap Data Package object that is the combination of
x
and y
.
Transformation details
Both x
and y
must have a unique dataset name x$name
and y$name
.
This name is used to prefix identifiers in the data that occur in both
datasets.
For example:
-
x
containsdeploymentID
sc("a", "b")
. -
y
containsdeploymentID
sc("b", "c")
. Then merged
xy
will containdeploymentID
sc("a", "x_b", "y_b", "c")
.
Data are merged as follows:
Deployments are combined, with
deploymentID
kept unique.Media are combined, with
mediaID
,deploymentID
andeventID
kept unique.Observations are combined, with
observationID
,deploymentID
,mediaID
andeventID
kept unique.Additional resources are retained, with the resource name kept unique.
Metadata properties are merged as follows:
-
name: Removed.
-
id: Removed.
-
created: Set to current timestamp.
-
title: Removed.
-
contributors: Combined, with duplicates removed.
-
description: Combined as two paragraphs.
-
version: Set to
1.0
. -
keywords: Combined, with duplicates removed.
-
image: Removed.
-
homepage: Removed.
-
sources: Combined, with duplicates removed.
-
licenses: Combined, with duplicates removed.
-
bibliographicCitation: Removed.
-
project$id: Removed.
-
project$title: Combined.
-
project$acronym: Removed.
-
project$description: Combined as two paragraphs.
-
project$path: Removed.
-
project$samplingDesign: Sampling design of
x
. -
project$captureMethod: Combined, with duplicates removed.
-
project$individuals:
TRUE
if one of the datasets hasTRUE
. -
project$observationLevel: Combined, with duplicates removed.
-
coordinatePrecision: Set to the least precise
coordinatePrecision
. -
spatial: Reset based on the new deployments.
-
temporal: Reset based on the new deployments.
-
taxonomic: Combined, with duplicates removed.
-
relatedIdentifiers: Combined, with duplicates removed.
-
references: Combined, with duplicates removed.
Custom properties of
x
are also retained.
See Also
Other transformation functions:
round_coordinates()
,
shift_time()
,
update_taxon()
,
write_dwc()
,
write_eml()
Examples
x <- example_dataset() %>%
filter_deployments(deploymentID %in% c("00a2c20d", "29b7d356"))
y <- example_dataset() %>%
filter_deployments(deploymentID %in% c("577b543a", "62c200a9"))
x$name <- "x"
y$name <- "y"
merge_camtrapdp(x, y)