Add Geolocator DP resources from a Geopressure Template
Source:R/add_gldp_geopressuretemplate.R
add_gldp_geopressuretemplate.Rd
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 creatingtag
based on the data indata/raw-tag/
) and"interim"
for data indata/interim
.- replace
If
TRUE
, the added resource will replace an existing resource with the same name.
Details
The function performs the following steps:
Reads the "tags.csv" and "observations.csv" files from the "./data" directory if they exist and adds them to the GLDP package.
Determines the source of the data files ("data" or "interim") if the
from
parameter is NULL.If
interim
, reads all interim ".RData" files, extract all resources possibles and add them to the package.If
raw-data
, create GeoPressureRtag
object from thedata/raw-data/
, compute thetags
andobservations
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"
.