Package 'piamValidation'

Title: Validation Tools for PIK-PIAM
Description: The piamValidation package provides validation tools for the Potsdam Integrated Assessment Modelling environment.
Authors: Pascal Weigmann [aut, cre] (affiliation: Potsdam Institute for Climate Impact Research, ORCID: <https://orcid.org/0000-0001-8801-173X>), Oliver Richters [aut] (affiliation: Potsdam Institute for Climate Impact Research, ORCID: <https://orcid.org/0000-0001-8253-4716>), Fabrice Lécuyer [aut] (affiliation: Potsdam Institute for Climate Impact Research, ORCID: <https://orcid.org/0000-0002-7364-999X>), Johannes Koch [aut] (affiliation: Potsdam Institute for Climate Impact Research, ORCID: <https://orcid.org/0000-0003-2920-8086>)
Maintainer: Pascal Weigmann <[email protected]>
License: LGPL-3
Version: 0.15.7
Built: 2026-05-13 14:59:53 UTC
Source: https://github.com/pik-piam/piamValidation

Help Index


Validation Tools for PIK-PIAM

Description

The piamValidation package provides validation tools for the Potsdam Integrated Assessment Modelling environment.

Author(s)

Maintainer: Pascal Weigmann [email protected] (ORCID) (Potsdam Institute for Climate Impact Research)

Authors:

  • Oliver Richters (ORCID) (Potsdam Institute for Climate Impact Research)

  • Fabrice Lécuyer (ORCID) (Potsdam Institute for Climate Impact Research)

  • Johannes Koch (ORCID) (Potsdam Institute for Climate Impact Research)

See Also

Useful links:


construct tooltips for interactive plots

Description

construct tooltips for interactive plots

Usage

appendTooltips(df)

Arguments

df

data.frame as returned from 'validateScenarios()'


Check variable consistency

Description

Test whether unit of on row of config and data for this variable match.

Usage

checkUnits(data, cfgRow)

Arguments

data

scenario or reference data for one variable

cfgRow

one row of a config file containing the same variable as the data object


Combine scenario and reference data with thresholds

Description

for one row of cfg: filter and merge relevant scenario data with cfg results in one df that contains scenario data, reference data and thresholds

Usage

combineData(scenData, cfgRow, histData = NULL)

Arguments

scenData

scenario data for one variable

cfgRow

one row of a config file

histData

reference data


import a config shipped with the package

Description

get a validation config file either from "inst/config" (.csv) or by providing a full path (.csv or .xlsx) or a tibble with the necessary columns see README or vignette for rules on how to fill the config

Usage

getConfig(config)

Arguments

config

name of validation config from "inst/config"


import IAM data for validation

Description

import IAM data for validation

Usage

importScenarioData(scenarioPath)

Arguments

scenarioPath

one or multiple paths to .mif, .csv, .rds or .xlsx file(s) or a data.frame containing scenario data in IAM format


takes the output of "validateScenarios()" creates a line plot

Description

takes the output of "validateScenarios()" creates a line plot

Usage

linePlotThresholds(
  valiData,
  scenData = NULL,
  refData = NULL,
  xlim = c(2010, 2030),
  interactive = TRUE
)

Arguments

valiData

data to be plotted, as returned by “validateScenarios()“ and after filtering for one variable and one region.

scenData

hand over additional scenario data to be plotted alongside the validation data. Will use the same variable and region, otherwise all available data.

refData

hand over additional reference data to be plotted alongside the validation data. Will use the same variable and region, otherwise all available data.

xlim

set limits for the x axis

interactive

decide if an interactive ggploty object should be returned


List available configs

Description

List all validation configuration files that are delivered with the package and can be directly imported with “getConfig()“ or used in “validateScenarios()“ and “validationReport()“.

Usage

listConfigs()

evaluate the content of the "ref_<type>" column and filter reference data accordingly. cases: - mode chosen - range - mean - no mode chosen - use mean if multiple references

Description

returns df without variable, unit and <type> columns (see below) returns df with ref_value_min/max, ref_model, ref_scenario, ref_period

Usage

refineRefData(ref_data, cfgRow, ref_type = "ref_model")

Arguments

ref_data

pre-filtered reference data

cfgRow

row of validation config used for this data slice

ref_type

historical, model, scenario, period


performs the validation checks from a config on a scenario data set

Description

performs the validation checks from a config on a scenario data set

Usage

validateScenarios(dataPath, config, outputFile = NULL, extraColors = TRUE)

Arguments

dataPath

one or multiple path(s) to scenario data in .mif or .csv format, in case of historic comparison, also path to reference data

config

select config from inst/config or give a full path to a config file on your computer

outputFile

give name of output file in case results should be exported; include file extension

extraColors

if TRUE, use cyan and blue for violation of min thresholds instead of using the same colors as for max thresholds (yel and red)


takes the output of "validateScenarios()" and plots heat maps per variable

Description

takes the output of "validateScenarios()" and plots heat maps per variable

Usage

validationHeatmap(
  valiData,
  main_dim = "variable",
  x_plot = NULL,
  y_plot = NULL,
  x_facet = NULL,
  y_facet = NULL,
  interactive = TRUE
)

Arguments

valiData

data to be plotted, as returned by “validateScenarios()“ (and “appendTooltips()“ if interactive), plus optional filtering. Needs to have at least one dimension with only one unique element.

main_dim

out of the 5-dim df, 1 dim has to contain only on element, this is the main dimension of the plot, default: variable

x_plot

choose dimension to display on x-axis of plot, if any is NULL, arrangement is chosen automatically based on data dimensions

y_plot

choose dimension to display on y-axis of plot

x_facet

choose dimension to display on x-dim of facets

y_facet

choose dimension to display on x-dim of facets

interactive

return plots as interactive plotly plots by default


returns information on whether scenarios passed critical validation checks

Description

returns information on whether scenarios passed critical validation checks

Usage

validationPass(data, yellowFail = FALSE)

Arguments

data

data.frame as returned from “validateScenarios()“

yellowFail

if set to TRUE a yellow check result of a critical variable will lead to the scenario not passing as validated


perform validateScenarios and create an .html report using .Rmd templates

Description

perform validateScenarios and create an .html report using .Rmd templates

Usage

validationReport(
  dataPath,
  config,
  report = "default",
  outputDir = "output",
  extraColors = TRUE
)

Arguments

dataPath

one or multiple path(s) to scenario data in .mif or .csv format

config

name a config from inst/config ("validationConfig_<name>.csv") or give a full path to a separate configuration file

report

name a .Rmd from inst/markdown ("validationReport_<name>.Rmd") to be rendered or give a full path to a separate .Rmd file

outputDir

choose a directory to save validation reports to

extraColors

if TRUE, use cyan and blue for violation of min thresholds instead of using the same colors as for max thresholds (yel and red)