Skip to contents

This function adds all possible resources to a Geolocator Data Package by reading data from a GeoPressureTemplate directories and files.

You can find more information on the use of this function in the GeoPressureManual

Usage

add_gldp_geopressuretemplate(
  pkg,
  directory = ".",
  from = c("raw-tag", "interim"),
  replace = FALSE
)

Arguments

pkg

A GeoLocator Data Package object.

directory

A character string specifying the geopressuretemplate directory.

from

A character vector specifying the source of the data files. Either or both of "raw-tag" (for creating tag based on the data in data/raw-tag/) and "interim" for data in data/interim.

replace

If TRUE, the added resource will replace an existing resource with the same name.

Value

The updated GLDP package object with added geopressure templates.

Details

The function performs the following steps:

  1. Reads the "tags.csv" and "observations.csv" files from the "./data" directory if they exist and adds them to the GLDP package.

  2. Determines the source of the data files ("data" or "interim") if the from parameter is NULL.

  3. If interim, reads all interim ".RData" files, extract all resources possibles and add them to the package.

  4. If raw-data, create GeoPressureR tag object from the data/raw-data/, compute the tags and observations resources and add them to the package.

You can exclude interim file to be included in the package by starting the file name with an _.

It is not possible to do a mix of some tag read from from="data" and some tag read from from="interim".