dot-write_metadata_cache: Write metadata cache file to disk

.write_metadata_cacheR Documentation

Write metadata cache file to disk

Description

Load all sites, read the metadata and write it to disk to cache the info for easy and fast access

Usage

.write_metadata_cache(folder, .dry = FALSE)

Arguments

folder

Route to the folder containing the data. Default to working directory

.dry

Dry run. Metadata is loaded and read, but no cache is written

Details

Load all data in memory to collect metadata info can be resource limiting. For easy and quick access to metadata, this function stores an .RData file in the specified folder along the data with all the metadata preloaded.

Value

A list of tibbles with the five metadata classes (site, stand, species, plant and environmental)

Examples

# Let's access the data in "folder". This typically is the folder where the
# sapflow data at the desired unit level is (i.e. "RData/plant"), but in this
# example we will create a temporal folder with some data to test the function
folder <- tempdir()
save(ARG_TRE, file = file.path(folder, 'ARG_TRE.RData'))
save(ARG_MAZ, file = file.path(folder, 'ARG_MAZ.RData'))

# lets create the metadata cache file
sapfluxnetr:::.write_metadata_cache(folder, .dry = FALSE)#' 
file.exists(file.path(folder, '.metadata_cache.RData')) # TRUE


sapfluxnetr documentation built on Feb. 16, 2023, 7:52 p.m.