pkgdown/analytics.html

Skip to contents

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.

Usage

merge_gldp(x, y = NULL, ...)

Arguments

x

A GeoLocator Data Package object, or a list of them.

y

A GeoLocator Data Package object.

...

Additional GeoLocator Data Package objects, or lists of them.

Value

A GeoLocator Data Package object containing the merged data from all inputs.

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_id is present in both packages.

datapackage_id in tags:

  • For the tags resource, each row must have a datapackage_id.

  • Missing datapackage_id values are filled with the package id.

  • The merge aborts if tags$datapackage_id overlaps 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 package id) is added as IsCompiledBy.

  • 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$datapackages is a one-row-per-source tibble keyed by datapackage_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 as numberTags_* 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))