View source: R/compareScenariosLimes.R
compareScenariosLimes | R Documentation |
Renders the *.Rmd-files associated to compareScenariosLimes. In the Rmds, scenario- and historical .mif-files are loaded. Then plots are created from this data. The result may be rendered to PDF or HTML. Alternatively one can choose Rmd as output format and obtain a copy of the *.Rmd-files.
compareScenariosLimes(
mifScen,
outputDir = getwd(),
outputFile = "compareScenariosLimes",
outputFormat = "PDF",
envir = new.env(),
quiet = FALSE,
...
)
mifScen |
|
outputDir |
|
outputFile |
|
outputFormat |
|
envir |
|
quiet |
|
... |
YAML parameters, see below. |
The value returned by rmarkdown::render()
.
cfgScen
character(n) or NULL
.
Paths to config.Rdata files containing the cfg
object for each
scenario. The paths must be provided in the same order as mifScen
.
If provided, some information gathered from these files is
shown at the beginning of the output document.
cfgDefault
character(1) or NULL
.
Path to default.cfg, which creates a cfg
object with default
values. If provided, some information gathered from this file is
shown at the beginning of the output document.
yearsScen
numeric(n)
.
Default: c(seq(2005, 2060, 5), seq(2070, 2100, 10))
.
Years to show for scenario data.
yearsHist
numeric(n)
.
Default: c(seq(1960, 2020, 1), seq(2025, 2100, 5))
.
Years to show for historical data.
yearsBarPlot
numeric(n)
.
Default: c(2010, 2030, 2050, 2100)
.
Years to show in bar plots of scenario data.
yearRef
numeric(1)
.
Default: 2020
.
A reference year used to show relative values in Kaya decomposition.
reg
NULL
or character(n)
.
Default: NULL
.
Regions to show. NULL
means all.
modelsHistExclude
character(n) or NULL
.
Default: c()
.
Models in historical data to exclude.
sections
character(n) or numeric(n) or NULL
.
Default: "all"
.
Names or numbers of sections to include. For names subset of
c("00_info", "01_summary", "02_macro", "03_emissions",
"04_energy_supply", "05_energy_demand", "06_energy_services",
"07_climate", "08_sdp", "09_carbon_management", "99_further_info")
.
Use "all"
to include all available sections.
Use NULL
to not include any section
(useful in combination with parameter envir
).
userSectionPath
NULL
or character(n)
.
Default: NULL
.
Path to a *.Rmd-file that may be included as additional section.
mainReg
character(1)
.
Default: "World"
.
A region for which larger plots are shown.
figWidth, figHeight
numeric(1)
.
Default: 15
and 10
, respectively.
Size of plots in inches.
warning
logical(1)
.
Default: TRUE
.
Show warnings in output?
Christof Schoetz
## Not run:
# Simple use. Creates PDF:
compareScenariosLimes(
mifScen = c("path/to/Base.mif", "path/to/NDC.mif"),
outputFile = "compareScenariosLimesExample")
# More complex use. Creates folder with Rmds:
compareScenariosLimes(
mifScen = c(ScenarioName1 = "path/to/scen1.mif", ScenarioName2 = "path/to/scen2.mif"),
cfgScen = c("path/to/scen1/config.RData", "path/to/scen2/config.RData"),
cfgDefault = "path/to/default.cfg",
outputDir = "path/to/output",
outputFormat = "Rmd",
outputFile = format(Sys.time(), "compScen_%Y%m%d-%H%M%S"),
warning = FALSE,
sections = c(0, 2, 3, 99),
userSectionPath = "path/to/myPlots.Rmd")
# Use in development. Load data into global environment:
compareScenariosLimes(
mifScen = c("path/to/scen1.mif", "path/to/scen2.mif"),
outputFile = format(Sys.time(), "cs2_load_%Y%m%d-%H%M%S"),
sections = NULL,
envir = globalenv())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.