Step By Step Full Example for gcamreport v6.0*
Source:vignettes/Step_By_Step_Full_Example_v6-0.Rmd
Step_By_Step_Full_Example_v6-0.Rmd
ATTENTION: this tutorial is compatible
with gcamreport v6.0*
, i.e, with
gcamreport v6.0.0
, gcamreport v6.0.1
, and
gcamreport v6.0.0-gas
releases. For other releases, please
check in the Tutorials drop-down menu in the main bar.
newline
In this tutorial we will 1) generate a dataset from a provided
GCAM6.0 database and run the associated user interface and 2) generate a
dataset from a provided project and run the corresponding user
interface. To know more about the gcamreport
package
possibilities, look at these tutorials: dataset
generation tutorial and user
interface tutorial.
newline
Example 1: step-by-step standardized dataset generation from a provided database
Follow the installation guide either with R Studio or Docker
Download the example GCAM6.0 database, store it inside
gcamreport/examples
, and unpack it.Generate the standardized dataset:
## -- load gcamreport library.
library(gcamreport)
## -- store the database path, name, and scenarios in a variable.
dbpath <- "examples"
dbname <- "database_basexdb_ref"
scen <- "Reference"
## -- choose a project name
prjname <- "example1.dat"
## -- generate the dataset until 2025, save the output in .csv and .xlsx format, and lunch the user interface
run(db_path = dbpath, db_name = dbname, scenarios = scen, prj_name = prjname, final_year = 2025, save_output = TRUE, launch_ui = TRUE)
Note: project generation requires approximately 30 minutes.
- Once the project has been generated and the standardized dataset
created, the user interface will prompt. If you are using R Studio, it
will automatically open. For a better experience, click the
open in browser
button. If you are using Docker, either type http://localhost:4000 in the browser or go to Docker Desktop and click the last started port.
Check the generated dataset: look at
examples
folder and you should see a file calledexample1_iamc_report.csv
and a file calledexample1_iamc_report.xlsx
containing the standardized dataset.Notice that in the
examples
folder a file calleddatabase_basexdb_ref_example1.dat
has appeared. It is the generated project file from the provided database. In case you want to generate the standardized dataset again or to open the user interface, you can use directly this file and avoid creating the project again. If you whish to proceed as mentioned, you can follow Example 2.
newline
Example 2: step-by-step standardized dataset generation from a provided project
Follow the installation guide either with R Studio or Docker
In this example we will use an example dataset stored in
examples
calledexample2.dat
Generate the standardized dataset:
## -- load gcamreport library.
library(gcamreport)
## -- store the database path, name, and scenarios in a variable.
projectpath <- "examples/example2.dat"
## -- generate the dataset until 2025, save the output in .csv and .xlsx format, and lunch the user interface
run(project_path = projectpath, final_year = 2025, save_output = TRUE, launch_ui = TRUE)
- Once the project has been generated and the standardized dataset
created, the user interface will prompt. If you are using R Studio, it
will automatically open. For a better experience, click the
open in browser
button. If you are using Docker, either type http://localhost:4000 in the browser or go to Docker Desktop and click the last started port.
- Check the generated dataset: look at
examples
folder and you should see a file calledexample2_iamc_report.csv
and a file calledexample2_iamc_report.xlsx
containing the standardized dataset.