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()
ℹ Loading scenariovettingcriteria
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)))))
}
[1] "release-2026-02-01: ...criteria/inst/extdata/release-2026-02-01" [1] "release-2026-06-01: ...criteria/inst/extdata/release-2026-06-01"
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_file(components, csv_engine = csv_engine): Unknown component: criteria-thresholds. Please choose one from: release-2026-02-01, release-2026-06-01
Traceback:
1. load_criteria("criteria-thresholds")
2. load_criteria_file(components, csv_engine = csv_engine) # at line 97 of file /home/philippv/Documents/4-projects/17-SCI/01-vcs/scenario-vetting-criteria/R/loading.R
3. stop(paste0("Unknown component: ", component, ". Please choose one from: ",
. toString(names(file_paths)))) # at line 6 of file /home/philippv/Documents/4-projects/17-SCI/01-vcs/scenario-vetting-criteria/R/loading.R
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_file(component, csv_engine = csv_engine): Unknown component: criteria-thresholds. Please choose one from: release-2026-02-01, release-2026-06-01
Traceback:
1. load_criteria(c("criteria-thresholds", "operations"))
2. load_criteria_file(component, csv_engine = csv_engine) # at line 102 of file /home/philippv/Documents/4-projects/17-SCI/01-vcs/scenario-vetting-criteria/R/loading.R
3. stop(paste0("Unknown component: ", component, ". Please choose one from: ",
. toString(names(file_paths)))) # at line 6 of file /home/philippv/Documents/4-projects/17-SCI/01-vcs/scenario-vetting-criteria/R/loading.R
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.