Get the version of CVs and Data Request
Usage
Cmip6Dict$version()
Returns
A list of two element:
Method is_empty()
Is it an empty Cmip6Dict?
$is_empty() checks if this Cmip6Dict is empty, i.e. the $build() or $load() method hasn't been called yet and there is no data of
CVs and Data Request.
Usage
Cmip6Dict$is_empty()
Returns
A single logical value of TRUE or FALSE.
Get the last modified time for CVs
Usage
Cmip6Dict$timestamp()
Returns
A list of 14 DateTimes:
"cvs": The last modified time for the whole CV collection
"drs": The last modified time for Data Reference Syntax (DRS)
"activity_id": The last modified time for Activity ID
"experiment_id": The last modified time for Experiment ID
"frequency": The last modified time for Frequency
"grid_label": The last modified time for Grid Label
"institution_id": The last modified time for Institution ID
"nominal_resolution": The last modified time for Nominal Resolution
"realm": The last modified time for Realm
"required_global_attributes": The last modified time for Required Global Attributes
"source_id": The last modified time for Source ID
"source_type": The last modified time for Source Type
"sub_experiment_id": The last modified time for Sub-Experiment ID
"table_id": The last modified time for Table ID
Method built_time()
Get the time when the dictionary was built
Usage
Cmip6Dict$built_time()
Method build()
Fetch and parse all data of CVs and Data Request
Usage
Cmip6Dict$build(token = NULL, force = FALSE)
Arguments
token
A string of GitHub token that is used to access GitHub
REST APIs. If NULL, GITHUB_PAT or GITHUB_TOKEN
environment variable will be used if exists. Default: NULL.
force
Whether to force to rebuild the dict when it has been
already built before. Default: FALSE.
Returns
The updated Cmip6Dict itself.
Get the data for a specific CV or Data Request
Usage
Cmip6Dict$get(type)
Arguments
type
A single string indicating the type of data to list.
Should be one of:
"drs": Data Reference Syntax (DRS)
"activity_id": Activity ID
"experiment_id": Experiment ID
"frequency": Frequency
"grid_label": Grid Label
"institution_id": Institution ID
"nominal_resolution": Nominal Resolution
"realm": Realm
"required_global_attributes": Required Global Attributes
"source_id": Source ID
"source_type": Source Type
"sub_experiment_id": Sub-Experiment ID
"table_id": Table ID
"dreq": Data Request
Returns
For "drs", "activity_id", "frequency", "grid_label", "institution_id", "source_type"and"sub_experiment_id"`, a
list.
For "experiment_id", "source_id" and "dreq", a data.table.
For "nominal_resolution", "required_global_attributes" and
"table_id", a character vector.
Save the Cmip6Dict object
$save() stores all the core data of current Cmip6Dict object into
an RDS file named CMIP6DICT in the specified folder.
This file can be reloaded via $load() method to restore the last
state of current Cmip6Dict object.
Usage
Cmip6Dict$save(dir = getOption("epwshiftr.dir", "."))
Arguments
dir
A single string giving the directory to save the RDS file.
Default is set to the global option epwshiftr.dir. The
directory will be created if not exists. If this global option
is not set, the current working directory is used.
Returns
A single string giving the full path of the RDS file.
Load the saved Cmip6Dict object from file
$load() loads the RDS file named CMIP6DICT that is created using
$save() method.
Please note that the file should be exactly the same as CMIP6DICT
without file extension.
Usage
Cmip6Dict$load(dir = getOption("epwshiftr.dir", "."))
Arguments
dir
A single string giving the directory to find the RDS file.
Default is set to the global option epwshiftr.dir. If this
global option is not set, the current working directory is
used.
Returns
A single string giving the full path of the RDS file.
Print a summary of the current Cmip6Dict object
$print() gives the summary of current Cmip6Dict object including
the version of CVs and Data Request, and the last built time.
Returns
The Cmip6Dict object itself, invisibly.