Skip to contents

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

The function performs the following steps:

  1. If "interim" in from, reads all interim ".RData" files, extract all resources possibles and add them to the package. tags and observations are generated automatically from param.

  2. If "raw-data" in from, create all the possible resources from data/raw-data/ and data/tag-label/. tags and observations resources are also generated from available information.

  3. Reads the tags.csv and observations.csv files from the ./data directory if they exist and overwrite the previously generated tags and observations.

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

It is possible to do a mix of some tag read from "interim" and other from "raw-data" simultaneously.

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 new resources