write_hep_summary_sheet: Write HEP summary sheet

Description Usage Arguments Value

View source: R/write_hep_summary_sheet.R

Description

write_hep_summary_sheet() writes all the content and styling for the HEP summary sheet. Used within export_hep_country_summary_xls()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
write_hep_summary_sheet(
  df,
  wb,
  sheet_name,
  iso,
  start_year = 2018,
  end_year = 2019:2025,
  value = "value",
  transform_value = "transform_value",
  year = "year",
  iso3 = "iso3",
  ind = "ind",
  scenario = "scenario",
  population = "population",
  type_col = "type",
  source_col = "source",
  ind_df,
  ind_ids
)

Arguments

df

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

wb

a openxlsx workbook to be edited.

sheet_name

character name of the sheet to update

iso

ISO3 code of country to summarize.

start_year

Base year for contribution calculation, defaults to 2018.

end_year

End year(s) for contribution calculation, defaults to 2019 to 2025.

value

Column name of column with indicator values.

transform_value

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

year

Column name of column with years.

iso3

Column name of column with country ISO3 codes.

ind

Column name of column with indicator names.

scenario

Column name of column with scenario identifiers. Useful for calculating contributions on data in long format rather than wide format.

population

Column name of column with population figures.

type_col

Column name of column with type data.

source_col

Column name of column to store source information.

ind_df

data frame containing the indicators in the correct order and format to be used.

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().

Value

openxslx Workbook object. Output file is in output_folder.


ElliottMess/rapporteur documentation built on Jan. 28, 2022, 2:51 a.m.