Skip to contents

Plot timeseries to provide line plots for each scenario present in df with some manipulations. Produce two faceted plots where each facet is an iso3.

Usage

plot_timeseries_indicator(
  df,
  iso3,
  indicator,
  scale = c("free", "fixed", "free_x", "free_y"),
  value_col = "value",
  default_scenario = "default",
  base_scenarios = c(routine = "routine", reference_infilling = "reference_infilling",
    covid_shock = "covid_shock"),
  start_year = 2018
)

Arguments

df

Data frame in long format filtered for a specific country, where 1 row corresponds to a specific year, and indicator.

iso3

vector of ISO3 country codes to plot

indicator

name of indicator to plot

scale

type of scale to be exported, as in facet_wrap

value_col

Column name of column(s) with indicator values, used to calculate contributions.

default_scenario

name of the default scenario.

base_scenarios

(vector) named vector with the names of the base scenarios. For more details see vignette("scenarios", package = "billionaiRe")

start_year

Base year for contribution calculation, defaults to 2018.

Value

a ggplot2 object