diff --git a/inst/compareScenarios/preprocessing.Rmd b/inst/compareScenarios/preprocessing.R similarity index 95% rename from inst/compareScenarios/preprocessing.Rmd rename to inst/compareScenarios/preprocessing.R index 58dc4f8..4b1730c 100644 --- a/inst/compareScenarios/preprocessing.Rmd +++ b/inst/compareScenarios/preprocessing.R @@ -1,11 +1,4 @@ -```{r load additional libraries} - -library(ggplot2) -library(dplyr) - -``` - -```{r reference models for historical} +# reference models for historical ---- # Sometimes it is necessary to choose a single model for the historical data, # e.g., calculating per capita variables. These reference models are defined here. @@ -15,12 +8,9 @@ histRefModel <- c( "GDP|PPP pCap" = "James_IMF" ) -options(mip.histRefModel = histRefModel) # nolint - -``` +options(mip.histRefModel = histRefModel) - -```{r load custom plotting function} +# load custom plotting function ---- showLinePlotsByVariable <- function( data, vars, xVar, scales = "free_y", @@ -109,9 +99,8 @@ showLinePlotsByVariable <- function( return(invisible(NULL)) } -``` +# calculate pCap variables ---- -```{r calcuate pCap variables} # For all variables in following table, add a new variable to data with the name # "OldName pCap". Calculate its value by OldValue * conversionFactor and set its unit to newUnit. # The new variable "OldName pCap" will be available in the plot sections. @@ -172,6 +161,3 @@ dataPCap data %>% bind_rows(dataPCap) -> data -``` - -