Skip to contents

This function adds geopressuretemplates to a GLDP package by reading data from specified directories and files.

Usage

add_gldp_geopressuretemplate(pkg, directory, from = NULL, replace = FALSE)

Arguments

pkg

A GLDP package object.

directory

A character string specifying the directory where the data files are located.

from

A character string specifying the source of the data files. Can be "raw-tag" (for creating tag based on the data in data/raw-tag/) or "interim" for data in data/interim. If NULL (default), the function will determine the source based on the presence of at least one file in the "interim" directory.

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. Reads all ".RData" files from the specified source directory and processes them.

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".

Examples

if (FALSE) { # \dontrun{
pkg <- create_gldp_package()
pkg <- add_gldp_geopressuretemplate(pkg, directory = "path/to/data")
} # }