Skip to contents

Main function. Creates/loads a GCAM project, standardizes the data and saves it in several forms (RData, CSV, and XLSX), runs vetting verifications, and launches the User Interface. You can specify the regions and/or variables to be reported and point either the `db_path`, the `db_name`, the `prj_name`, and `scenarios` to create a new project and produce the standardized report; or the `prj_name` and `scenarios` to produce the report of an existing project. The resulting RData output can be used to manually call `launch_gcamreport_ui`.

Usage

generate_report(
  db_path = NULL,
  db_name = NULL,
  prj_name,
  scenarios = NULL,
  final_year = 2100,
  desired_variables = "All",
  desired_regions = "All",
  desired_continents = "All",
  save_output = TRUE,
  output_file = NULL,
  launch_ui = TRUE,
  ghg_GWP = gcamreport::ghg_GWP_AR5,
  queries_general_file = gcamreport::queries_general,
  queries_nonCO2_file = gcamreport::queries_nonCO2
)

Arguments

db_path

full path of the GCAM database.

db_name

name of the GCAM database.

prj_name

name of the rgcam project. This can be an existing project name, in which case the project will be loaded, or a new project name, in which case a new project will be created.. Possible extensions: .dat and .proj.

scenarios

name of the scenarios to be considered. By default, all the scenarios in the project or the database are considered.

final_year

final year of the data. By default = 2100. ATENTION: final_year must be at least 2025.

desired_variables

desired variables to have in the report. Considered 'All' by default. Otherwise, specify a vector with all the desired options. To know all possible options, run `available_variables()`. In case the project dataset needs to be created, it will be created containing only the specified variables. ATTENTION: global variables such as "Emissions" will be computed considering only the selected variables. As an example, if you select "Emissions" and "Emissions|CO2", "Emissions" will only account for "Emissions|CO2", and will not consider other variables, such as "Emissions|CH4" or "Emissions|NH3"

desired_regions

desired regions to consider. By default, 'All'. Otherwise, specify a vector with all the considered regions. To know all possible regions, run `available_regions()`. ATTENTION: the considered regions will make up "World". In case the project dataset needs to be created, it will be produced with only the specified regions.

desired_continents

desired continents/regions' groups to consider. By default, 'All'. Otherwise, specify a vector with all the considered continents/regions' groups. To know all possibilities, run `available_continents()`. ATTENTION: the considered continents/regions' groups will make up "World". In case the project dataset needs to be created, it will be produced with only the specified continents/regions' groups.

save_output

if TRUE, save reporting data in CSV and XLSX formats. If FALSE, do not save data. If 'save_output = CSV' or 'save_output = XLSX', the data will be only saved in the specified format.

output_file

file path and name of the saved data. Not used if data not saved. By default, saved in the same directory of the database or the project file, and using a default name containing the project name with 'standardized' tag. In case of specifying the `output_file`, introduce a whole path (e.g. /path/to/output/fileName) without extension tag, it will be automatically added.

launch_ui

if TRUE, launch User Interface, Do not launch it otherwise.

ghg_GWP

GWP conversion. Options: gcamreport::ghg_GWP_AR4, gcamreport::ghg_GWP_AR5 (default), and gcamreport::ghg_GWP_AR6.

queries_general_file

full path to a general xml query file (including file name and extension). By default it points to the gcamreport general query file, compatible with the latest GCAM version and able to report all standardized variables.

queries_nonCO2_file

full path to an xml query file (including file name and extension) designed to load long nonCO2 queries: "nonCO2 emissions by sector (excluding resource production)" and "nonCO2 emissions by region". By default it points to the gcamreport nonCO2 query file, compatible with the latest GCAM version and necessary to report some of the standardized variables.

Value

RData, CSV, and XLSX saved datafiles with the desired standardized variables, launches user interface, and save the rgcam project file (if created).