mipLineHistorical: Compares data by producing line plot

View source: R/mipLineHistorical.R

mipLineHistoricalR Documentation

Compares data by producing line plot

Description

Compares data by producing line plot

Usage

mipLineHistorical(
  x,
  x_hist = NULL,
  color.dim = "identifier",
  linetype.dim = NULL,
  facet.dim = "region",
  funnel.dim = NULL,
  ylab = NULL,
  xlab = "Year",
  title = NULL,
  color.dim.name = NULL,
  ybreaks = NULL,
  ylim = 0,
  ylog = NULL,
  size = 14,
  scales = "fixed",
  leg.proj = FALSE,
  plot.priority = c("x", "x_hist", "x_proj"),
  ggobject = TRUE,
  paper_style = FALSE,
  xlim = NULL,
  facet.ncol = 3,
  legend.ncol = 1,
  hlines = NULL,
  hlines.labels = NULL,
  color.dim.manual = NULL,
  color.dim.manual.hist = NULL
)

Arguments

x

Data to plot. Allowed data formats: magpie or quitte

x_hist

historical data to plot. Allowed data formats: magpie or quitte, If no historic information is provided the plot will ignore it.

color.dim

dimension used for different colors, default="identifier"; can only be chosen freely if x_hist is NULL.

linetype.dim

dimension used for different line types, default=NULL

facet.dim

dimension used for the facets, default="region"

funnel.dim

dimension used for different funnels, default=NULL

ylab

y-axis label

xlab

x-axis label, default="Year"

title

title of the plot

color.dim.name

name for the color-dimension used in the legend

ybreaks

add breaks for the y axis

ylim

y limits

ylog

=T if the-axis should be logarithmic

size

text size in the plot

scales

Are scales shared across all facets (the default, "fixed"), or do they vary across rows ("free_x"), columns ("free_y"), or both rows and columns ("free")

leg.proj

to add a detailed legend for the projected data. Default is FALSE.

plot.priority

Sets the order of ploting and overlap of the data by specifying a vector of three stirng elements. Argument x stands for model output, x_hist is for obeserved (historical data) and x_proj is for projected data from other models.

ggobject

returns a ggplot object. Default is TRUE.

paper_style

removes grey color from facets if TRUE Default is FALSE.

xlim

x axis limits as vector with min and max year

facet.ncol

number of columns used for faceting, default=3.

legend.ncol

number of columns used in legends, default=1.

hlines

optional horizontal lines to be added to the plot, Allowed data formats: magpie, Default is NULL.

hlines.labels

optional labels for horizontal lines, Allowed data formats: named vector, where each name corresponds to exactly one variable in hlines, Default is NULL.

color.dim.manual

optional vector with manual colors replacing default colors of color.dim, default is NULL.

color.dim.manual.hist

optional vector with manual colors replacing default colors of color.dim for historical data, default is NULL.

Example Plot

example plot example plot

Author(s)

Lavinia Baumstark, Mishko Stevanovic, Florian Humpenoeder

Examples


  ## Not run: 
    p <- mipLineHistorical(x,x_hist=hist,ylab="example",xlab="Year",title=NULL)
  
## End(Not run)

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