showAreaAndBarPlotsPlus: Show Area and Bar Plots Utilizing '+'-Notation

View source: R/showAreaAndBarPlotsPlus.R

showAreaAndBarPlotsPlusR Documentation

Show Area and Bar Plots Utilizing '+'-Notation

Description

Automatically infers disaggregation of a variable using the '+'-notation and calls showAreaAndBarPlots.

Usage

showAreaAndBarPlotsPlus(
  data,
  tot,
  plusNum = 1,
  fill = FALSE,
  mainReg = getOption("mip.mainReg"),
  yearsBarPlot = getOption("mip.yearsBarPlot"),
  scales = "free_y"
)

Arguments

data

A quitte object or an object that can be transformed into a quitte object.

tot

A single string. A total value to be shown in the area plots.

plusNum

A single number. Number of "+"symbols for disaggregation.

fill

Logical. Should the vars be normalized so that their values add to 1? (Plot shares instead of absolute values.)

mainReg

A single string. The plots for this region are shown enlarged. Use options(mip.mainReg=<value>) to set globally.

yearsBarPlot

A numeric vector. The years shown in the bar plots. Use options(mip.yearsBarPlot=<value>) to set globally.

scales

adjusts how axes are harmonized. Default is free_y

Details

The function requires data to have a character column named varplus containing variable names that use the '+'-notaion. The function searches for values in varplus that start with tot followed by "|", plusNum-times "+", and "|". These variables are then used in a call to showAreaAndBarPlots.

Value

NULL is returned invisible.

Examples

## Not run: 
options(mip.yearsBarPlot = c(2010, 2030, 2050, 2100))
options(mip.mainReg = "World")
data <- as.quitte(data)
showAreaAndBarPlotsPlus(data, "SE|Liquids")

## End(Not run)

pik-piam/mip documentation built on April 5, 2024, 12:31 p.m.