Skip to contents

export_plot_timeseries_indicator_pdf exports plots to pdf.

Usage

export_plot_timeseries_indicator_pdf(
  df,
  indicator,
  scale = c("combined", "free", "fixed", "free_x", "free_y"),
  output_folder = "outputs",
  experiment = NULL,
  group_iso3 = TRUE,
  default_scenario = "default",
  value_col = "value",
  start_year = 2018,
  ind_ids = billionaiRe::billion_ind_codes("all", include_calculated = TRUE),
  version = whdh::get_formatted_timestamp()
)

Arguments

df

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

indicator

name of indicator to plot

scale

type of scale to be exported. Can be either:

  • common: same scale for all iso3

  • free: individual scale for each iso3

  • combined: combination of common and free. By default, combined is used

output_folder

Folder path to where the Excel files should be written

experiment

name of the experiment of plots. Default to NULL. If used, a new folder will be added to output_folder to store the results.

group_iso3

if TRUE (default), iso3s will be grouped by 54 to have more readable graphs.

default_scenario

name of the default scenario.

value_col

Column name of column with indicator values.

start_year

Base year for contribution calculation, defaults to 2018.

ind_ids

Named vector of indicator codes for input indicators to the Billion. Although separate indicator codes can be used than the standard, they must be supplied as a named vector where the names correspond to the output of billion_ind_codes().

version

character vector identifying the version of the plot to be passed.

Value

openxslx Workbook object. Output file is in output_folder.