View source: R/showMultiLinePlotsByVariable.R
showMultiLinePlotsByVariable | R Documentation |
Show plots with different regions in the same plot; x-axis variable chosen by user.
showMultiLinePlotsByVariable(
data,
vars,
xVar,
scales = "free_y",
showHistorical = FALSE,
showGlobal = FALSE,
nrowNum = 1,
mainReg = getOption("mip.mainReg"),
histRefModel = getOption("mip.histRefModel"),
yearsByVariable = getOption("mip.yearsBarPlot")
)
data |
A quitte object or an object that can be transformed into a quitte object. |
vars |
A character vector. The variables to be plotted. |
xVar |
A single string. The variable for the x-axis. |
scales |
A single string. choose either |
showHistorical |
A single logical value. Should historical data be
shown? It is not recommended to set this to |
showGlobal |
A single logical value. Should global data be shown? Default is false to save space in pdf |
nrowNum |
An integer value. Number of rows of the panel figures |
mainReg |
A single string. The plots for this region are shown enlarged.
Use |
histRefModel |
A named character vector identifying the unique model to
be chosen for historical data. Use |
yearsByVariable |
A numeric vector. The years to be marked in the plots.
As default it uses the value globally set by |
Same as showMultiLinePlots
but with the variable specified by
xVar
on x-axis. For every y-axis-value, we need a unique x-axis-value.
For historical data, there may be several sources / models of the same
variable. For the x-axis-variable a unique historical source / model is
chosen via histRefModel
.
NULL
is returned invisible.
page 1: page 2:
## Not run:
options(mip.mainReg = "World")
options(mip.yearsBarPlot = c(2010, 2030, 2050, 2100))
options(mip.histRefModel = c("GDP|PPP pCap" = "James_IMF"))
data <- as.quitte(data)
vars <- c(
"FE|Transport pCap",
"FE|Buildings pCap",
"FE|Industry pCap")
showMultiLinePlotsByVariable(data, vars, "GDP|PPP pCap")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.