dot-write_metadata_cache: Write metadata cache file to disk

Description Usage Arguments Details Value Examples

Description

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

Usage

1
.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 readed, 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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 Aug. 28, 2020, 1:13 a.m.