pkgdown/analytics.html Skip to contents

Read a GeoPressureTemplate project and populate a GeoLocator Data Package with the resources that can be derived from it.

The import can combine two sources:

  1. "interim": read .RData outputs from data/interim/, convert them to package resources, and store raw parameter objects in pkg$params. Each file must hold tag and param. Trajectories are the variables named path_<type>, edge_<type> and pressurepath_<type>, where <type> is a trajectory type of GeoLocator-DP (tag, most_likely, simulation or geopressureviz); other types are skipped with a warning.

  2. "raw-tag": create tag objects from data/raw-tag/ and config.yml, then derive measurements, tags, observations, and params.

Interim files may have been written by an older GeoPressureR. As when read_gldp() upgrades a package to GeoLocator-DP v1.3, SOI magnetic and acceleration axes are converted to the forward-right-down frame when the params of the tag record the mapping applied, and the groundspeed of simulated edges is recomputed for tags whose params record GeoPressureR 3.2.0 to 3.7.0. Other data are left as stored.

The ring_number, tag_comments and bird_create$scientific_name entries of each tag in config.yml fill the generated tags. They are read with config::get(), so a tag inherits them from the default entry, and numbers are kept as written (an unquoted ring number 0012345 stays "0012345").

Manual data files take precedence over generated metadata:

  • data/tags.csv or data/tags.xlsx replaces generated tags. Tags missing from the file are kept from the generated table, with a warning;

  • data/observations.csv or data/observations.xlsx replaces generated observations. Generated observations take their ring_number from tags.

During automatic discovery, GeoLocatoR skips private GeoPressureTemplate entries whose names start with "_": config keys, interim files, raw-tag folders, and files inside raw-tag folders. Empty raw-tag folders are also skipped, so raw-tag import only attempts folders with at least one non-ignored file.

See the GeoPressureManual for a full workflow example.

Usage

read_geopressuretemplate(
  directory = ".",
  from = c("raw-tag", "interim"),
  pkg = create_gldp()
)

Arguments

directory

Path to the GeoPressureTemplate directory.

from

Character vector specifying which sources to import. Supported values are "raw-tag" and/or "interim".

pkg

Optional GeoLocator Data Package object to fill. Defaults to a new package created with create_gldp(). Its metadata is kept, but any existing resources are overwritten. Overwriting asks for confirmation, so a pkg with resources can only be used in an interactive session.

Value

The updated geolocatordp object.

See also

create_geopressuretemplate() to create a project from a package, params_to_tags(), params_to_observations(), and tags_to_measurements() for the underlying conversions.