Merges two or more GeoLocator Data Package objects into a single combined package. The metadata properties from both packages are merged according to specific rules, and resource data is combined based on their presence in either package.
Details
Input formats:
merge_gldp(x, y, ...)merge_gldp(list(x, y, ...))merge_gldp(x, list(y, ...))
Resource merging logic:
A resource is added even if only one input package contains it.
For each resource, rows from available inputs are combined with
dplyr::bind_rows().
Check for unique tag_id:
The merge aborts if any
tag_idis present in both packages.
datapackage_id in tags:
For the
tagsresource, each row must have adatapackage_id.Missing
datapackage_idvalues are filled with the packageid.The merge aborts if
tags$datapackage_idoverlaps between the two inputs.
Metadata merging rules:
version: Uses the package default version from
create_gldp().title: Combined from both packages, separated by a "/".
contributors: Combined from both packages, with duplicates removed.
licenses: Combined, with duplicates removed.
record_type: Combined from both packages, with duplicates removed.
codeRepository: Combined from both packages, with duplicates removed.
datapackages: Carries the merged provenance table described above.
relatedIdentifiers: Combined, with duplicates removed, and each unique source
datapackage_id(or packageid) is added asIsCompiledBy.params: Concatenated from all inputs; every entry must contain a non-empty
param$id.created: Set to the current timestamp at the time of merging.
All others are dropped
datapackages provenance table:
pkg$datapackagesis a one-row-per-source tibble keyed bydatapackage_id(pkg$id) and accumulated across sequential merges.It includes key source metadata fields (e.g. title/version/status/access), temporal coverage (
temporal_start,temporal_end), taxonomic summary (taxonomic), and resource/sensor counts asnumberTags_*columns.
See also
create_gldp() to create package shells and update_gldp() for the
derived properties recomputed on the merged package.
Examples
pkg1 <- read_zenodo("17367319")
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ℹ Retrieve Zenodo record 17367319
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Retrieve Zenodo record 17367319 [1s]
#>
#> ℹ Download files from Zenodo
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Download files from Zenodo [3.5s]
#>
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Upgrading GeoLocator-DP from "main" to "v1.0".
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Read and upgrade GeoLocator-DP [1.1s]
#>
#> ℹ Add metadata
#> ✔ Add metadata [270ms]
#>
pkg2 <- read_zenodo("17257520")
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ℹ Retrieve Zenodo record 17257520
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Retrieve Zenodo record 17257520 [676ms]
#>
#> ℹ Download files from Zenodo
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Download files from Zenodo [2.2s]
#>
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Upgrading GeoLocator-DP from "main" to "v1.0".
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Read and upgrade GeoLocator-DP [597ms]
#>
#> ℹ Add metadata
#> ✔ Add metadata [77ms]
#>
merged <- merge_gldp(pkg1, pkg2)
merged
#>
#> ── A GeoLocator Data Package `pkg` (v1.0) ──────────────────────────────────────
#>
#> ── Metadata
#> Note: All green texts are fields of `pkg` which can be accessed with `pkg$field`).
#> • title: "GeoLocator Data Package: Barred Warblers from Czechia / GeoLocator
#> Data Package: Lesser Grey Shrike in Slovakia"
#> • contributors:
#> Joanna Wong (researcher) - <https://orcid.org/0000-0003-4607-2803>
#> Peter Adamik (supervisor) - <https://orcid.org/0000-0003-1566-1234>
#> Miroslav Bažant (datacollector) - <https://orcid.org/0000-0001-9404-2815>
#> Steffen Hahn (projectleader) - <https://orcid.org/0000-0002-4924-495X>
#> Peter Adamik (projectleader) - <https://orcid.org/0000-0003-1566-1234>
#> Steffen Hahn (supervisor) - <https://orcid.org/0000-0002-4924-495X>
#> Anton Kristin (projectleader) - <https://orcid.org/0000-0001-7422-6393>
#> ✔ access: Open access
#> • licenses: Creative Commons Attribution 4.0 International (cc-by-4.0) - {.url
#> https://creativecommons.org/licenses/by/4.0/legalcode}
#> • codeRepository: <https://github.com/jobzwong/CurNis.git>
#> ! community: no Geolocator DP community
#> • relatedIdentifiers:
#> isdescribedby <https://doi.org/10.25225/jvb.23085>
#> continues <https://doi.org/10.5281/zenodo.10209430>
#> continues <Movebank ID: 3146197948>
#> isdescribedby <https://doi.org/10.1007/s10336-023-02102-7>
#> continues <https://doi.org/10.5281/zenodo.7556866>
#> IsCompiledBy <https://doi.org/10.5281/zenodo.17367319>
#> IsCompiledBy <https://doi.org/10.5281/zenodo.17257520>
#> • created: 2026-04-09 03:09:00
#> • bibliographicCitation: "Wong J, Adamik P, Bažant M, Hahn S, Adamik P, Hahn S,
#> Kristin A (2026). “GeoLocator Data Package: Barred Warblers from Czechia /
#> GeoLocator Data Package: Lesser Grey Shrike in Slovakia.”"
#> • temporal: "2017-06-20" to "2020-03-13"
#> • taxonomic: "Curruca nisoria" and "Lanius minor"
#> • numberTags: tags: 3, measurements: 3, light: 3, pressure: 3, activity: 3,
#> temperature_external: 1, paths: 3, pressurepaths: 3
#>
#> ── Resources: (8 resources)
#> • `tags()` (n=3)
#> • `observations()` (n=6)
#> • `measurements()` (n=771,480)
#> • `staps()` (n=102)
#> • `twilights()` (n=1,660)
#> • `paths()` (n=1,122)
#> • `edges()` (n=1,089)
#> • `pressurepaths()` (n=39,826)
# List-style input is also supported
merged <- merge_gldp(list(pkg1, pkg2))
