View source: R/showAreaAndBarPlots.R
showAreaAndBarPlots | R Documentation |
Creates 4 sets of plots from scenario data and shows them.
showAreaAndBarPlots(
data,
vars,
tot = NULL,
fill = FALSE,
orderVars = c("mean", "user", "userRev"),
mainReg = getOption("mip.mainReg"),
yearsBarPlot = getOption("mip.yearsBarPlot"),
scales = "free_y"
)
data |
A quitte object or an object that can be transformed into a quitte object. |
vars |
A character vector. The variables to be plotted. |
tot |
A single string. A total value to be shown in the area plots. |
fill |
Logical. Should the vars be normalized so that their values add to 1? (Plot shares instead of absolute values.) |
orderVars |
In what order should the variables be shown?
|
mainReg |
A single string. The plots for this region are shown enlarged.
Use |
yearsBarPlot |
A numeric vector. The years shown in the bar plots. Use
|
scales |
adjusts how axes are harmonized. Default is free_y |
Creates 2 sets of area plots (main region + others) and 2 sets of bar plots
(main region + others) of the variables specified in vars over time. For area
plots, faceting is done by region and scenario; for bar plots over region. If
a variables is given in tot, this is shown as a black line. If not the sum of
the values of vars is drawn. If fill=TRUE
, the values of vars are
divided by the values of tot to show share of total. The plots arranged and
shown.
NULL
is returned invisible.
page 1 - fill=FALSE
:
page 2 - fill=FALSE
:
page 1 - fill=TRUE
:
page 2 - fill=TRUE
:
## Not run:
options(mip.yearsBarPlot = c(2010, 2030, 2050, 2100))
options(mip.mainReg = "World")
data <- as.quitte(data)
vars <- c(
"FE|CDR",
"FE|Transport",
"FE|Buildings",
"FE|Industry")
showAreaAndBarPlots(data, vars)
showAreaAndBarPlots(data, vars, orderVars = "user")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.