R
This has to be run in order to compile this notebook while the R package is still under development.
In [1]:
Copied!
devtools::load_all()
devtools::load_all()
Error in loadNamespace(x): there is no package called ‘devtools’ Traceback: 1. withRestarts(stop(cond), retry_loadNamespace = function() NULL) 2. withOneRestart(expr, restarts[[1L]]) 3. doWithOneRestart(return(expr), restart) 4. stop(cond)
Installation¶
While the R package has not been released yet, you have to install it from GitHub source using:
devtools::install_github('PhilippVerpoort/scenario-vetting-criteria')
Raw file paths¶
The package contains definition files for the criteria. The paths to those files are contained in file_paths.
In [2]:
Copied!
library(scenariovettingcriteria)
for (component_id in names(file_paths)) {
component_path <- file_paths[[component_id]]
print(paste0(component_id, ": ...", substr(as.character(component_path), nchar(as.character(component_path)) - 39, nchar(as.character(component_path)))))
}
library(scenariovettingcriteria)
for (component_id in names(file_paths)) {
component_path <- file_paths[[component_id]]
print(paste0(component_id, ": ...", substr(as.character(component_path), nchar(as.character(component_path)) - 39, nchar(as.character(component_path)))))
}
Error in library(scenariovettingcriteria): there is no package called ‘scenariovettingcriteria’ Traceback: 1. stop(packageNotFoundError(package, lib.loc, sys.call()))
Load functions¶
Instead of loading the data from these files manually, it is recommended to use the built-in load functions from the package via load_criteria. For instance, the following will load the definition of the thresholds values.
In [3]:
Copied!
load_criteria('criteria-thresholds')
load_criteria('criteria-thresholds')
Error in load_criteria("criteria-thresholds"): could not find function "load_criteria"
Traceback:
Multiple files can be loaded in one go.
In [4]:
Copied!
criteria <- load_criteria(c('criteria-thresholds', 'operations'))
criteria$operations
criteria <- load_criteria(c('criteria-thresholds', 'operations'))
criteria$operations
Error in load_criteria(c("criteria-thresholds", "operations")): could not find function "load_criteria"
Traceback:
Apply vetting criteria to scenarios¶
A tutorial on how to apply the vetting criteria to a list of scenarios based on piamValidation will be made available later.