append_metadata: Append Movebank reference data to Movebank GPS data

View source: R/append_metadata.R

append_metadataR Documentation

Append Movebank reference data to Movebank GPS data

Description

This function joins Movebank GPS data with Movebank reference (meta)data, on the shared columns:

  • gps.tag-local-identifier = ref_data.tag-id

  • gps.individual-local-identifier = ref_data.animal-id

  • gps.individual-taxon-canonical-name = ref_data.animal-taxon

Usage

append_metadata(gps, ref_data, ref_cols = NULL)

Arguments

gps

data.frame, data.table or matrix. Movebank GPS data with at least the columns used for the join: individual-taxon-canonical-name, tag-local-identifier and individual-local-identifier.

ref_data

data.frame, data.table or matrix. Movebank reference data with at least the columns defined in ref_cols.

ref_cols

character vector. Column names of ref_data to be added to gps. Defaults to NULL, adding all columns. When specified, it must at least contain the columns used for the join: tag-id, animal-id and animal-taxon. Columns that have same name as the columns of gps are dropped with a warning.

Details

GPS and reference data can be downloaded from Movebank.

Value

A data.table with the GPS data (all columns except those used in the join) appended with the reference data (all columns defined in ref_cols).

Examples

# Default use
append_metadata(lbbg_gps, lbbg_ref_data)

# Only include specific reference data columns
append_metadata(lbbg_gps,
                lbbg_ref_data,
                ref_cols = c("animal-taxon",
                             "tag-id",
                             "animal-id",
                             "animal-comments",
                             "animal-life-stage",
                             "animal-mass",
                             "animal-sex",
                             "deployment-comments")
)

inbo/bird-tracking-etl documentation built on Nov. 25, 2022, 10:10 p.m.