From a763f6bed9c836320226d362c1e917a58c84ec27 Mon Sep 17 00:00:00 2001 From: klau506 Date: Tue, 27 Aug 2024 16:25:24 +0200 Subject: [PATCH] update doc for the new gcamreport structure --- DESCRIPTION | 4 +- R/main.R | 6 +- README.md | 72 +-- _pkgdown.yml | 4 +- examples/demo.R | 82 ---- examples/example2_standardized.RData | Bin 1281 -> 0 bytes examples/example2_v6.0.dat | Bin 0 -> 7824 bytes examples/{example2.dat => example2_v7.0.dat} | Bin examples/example2_v7.1.dat | Bin 0 -> 15680 bytes examples/example2_v7.1_standardized.RData | Bin 0 -> 2775 bytes examples/example2_v7.1_standardized.csv | 31 ++ examples/example2_v7.1_standardized.xlsx | Bin 0 -> 8983 bytes examples/example3_v6.0.RData | Bin 0 -> 1871 bytes .../{example3.RData => example3_v7.0.RData} | Bin examples/example3_v7.1.RData | Bin 0 -> 2775 bytes man/launch_gcamreport_ui.Rd | 4 +- vignettes/Dataset_Generation_Tutorial.Rmd | 127 ++++- .../Dataset_Generation_Tutorial_v7-0.Rmd | 455 ++++++++++++++++++ vignettes/Interactive_UI_Tutorial.Rmd | 16 +- vignettes/Interactive_UI_Tutorial_v7-0.Rmd | 177 +++++++ .../Modify_Mapping_Template_Tutorial.Rmd | 256 ++++++++-- vignettes/README_v7-0.Rmd | 342 +++++++++++++ vignettes/Step_By_Step_Full_Example.Rmd | 41 +- vignettes/Step_By_Step_Full_Example_v7-0.Rmd | 201 ++++++++ vignettes/Version_Guide.Rmd | 44 +- vignettes/gcamreport_v7-0.Rmd | 21 + 26 files changed, 1664 insertions(+), 219 deletions(-) delete mode 100644 examples/demo.R delete mode 100644 examples/example2_standardized.RData create mode 100644 examples/example2_v6.0.dat rename examples/{example2.dat => example2_v7.0.dat} (100%) create mode 100644 examples/example2_v7.1.dat create mode 100644 examples/example2_v7.1_standardized.RData create mode 100644 examples/example2_v7.1_standardized.csv create mode 100644 examples/example2_v7.1_standardized.xlsx create mode 100644 examples/example3_v6.0.RData rename examples/{example3.RData => example3_v7.0.RData} (100%) create mode 100644 examples/example3_v7.1.RData create mode 100644 vignettes/Dataset_Generation_Tutorial_v7-0.Rmd create mode 100644 vignettes/Interactive_UI_Tutorial_v7-0.Rmd create mode 100644 vignettes/README_v7-0.Rmd create mode 100644 vignettes/Step_By_Step_Full_Example_v7-0.Rmd create mode 100644 vignettes/gcamreport_v7-0.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 2375d71d..ee3a473d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,12 @@ Package: gcamreport Title: gcamreport -Version: 7.0.1 +Version: 1.0.0 Authors@R: c(person("Clàudia", "Rodés-Bachs", email = "claudia.rodes@bc3research.org", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-6696-7685")), person("Jon", "Sampedro", email = "jon.sampedro@bc3research.org", role = c("aut"), comment = c(ORCID = "0000-0002-2277-1530")), + person("Russell", "Horowitz", email = "russell.horowitz@bc3research.org", role = c("aut"), + comment = c(ORCID = "0000-0002-0270-3127")), person("Dirk-Jan", "Van de Ven", email = "dj.vandeven@bc3research.org", role = c("aut"), comment = c(ORCID = "0000-0001-9120-564X"))) Description: R package to produce standard IPCC reports from GCAM output. diff --git a/R/main.R b/R/main.R index 6d83cbe0..b77c8fbe 100644 --- a/R/main.R +++ b/R/main.R @@ -846,11 +846,12 @@ generate_report <- function(db_path = NULL, db_name = NULL, prj_name, scenarios #' #' @param data_path Optional. Path to an RData file containing the standardized data. If provided, this file will be used to load the data into the Shiny application. You can obtain this dataset using `gcamreport::generate_report`. #' @param data Optional. An R dataframe or list containing the standardized data. If provided, this data will be used directly in the Shiny application. You can obtain this dataset using `gcamreport::generate_report`. +#' @param GCAM_version Main GCAM compatible version: 'v7.0' (default), 'v7.1', or 'v6.0'. #' #' @return Launches the Shiny interactive UI. This function does not return a value but starts the Shiny application for user interaction. #' #' @export -launch_gcamreport_ui <- function(data_path = NULL, data = NULL) { +launch_gcamreport_ui <- function(data_path = NULL, data = NULL, GCAM_version = 'v7.0') { # check the user input if (is.null(data_path) && is.null(data)) { stop("Error: Neither 'data_path' nor 'data' has been provided. Please specify at least one of these: 'data_path' to point to the location of the dataset file or 'data' to provide the dataset directly.") @@ -863,6 +864,9 @@ launch_gcamreport_ui <- function(data_path = NULL, data = NULL) { data <- assign("data", get(load(data_path))) } + # make GCAM_version a global variable + GCAM_version <<- GCAM_version + # define the dataset for launching the ui sdata <<- suppressWarnings( data %>% diff --git a/README.md b/README.md index 877020c5..e8a7c3c5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![paper](https://github.com/bc3LC/gcamreport/actions/workflows/draft-pdf.yml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/paper/paper.pdf) [![status](https://joss.theoj.org/papers/816fd8765945cd5f6fe6d8d1fefdde19/status.svg)](https://joss.theoj.org/papers/816fd8765945cd5f6fe6d8d1fefdde19) +
+ @@ -32,7 +34,10 @@ - [Getting Started](#get-started) -- [Warnings and Error Messages](#bugs) +- [Top common Warnings and Error Messages](#bugs) + + +
@@ -46,7 +51,9 @@ [Back to Contents](#contents) -`gcamreport` is a tool that generates a consistent dataset from any scenario run by the Global Change Analysis Model ([GCAM](http://www.globalchange.umd.edu/gcam/)) that meets the reporting requirements of the Integrated Assessment Modeling Consortium ([IAMC](https://www.iamconsortium.org/)). In addition, `gcamreport` includes an interactive user widget that allows users to generate and download plots live, as well as download reduced versions of the formatted dataset in spreadsheet format. +`gcamreport` is a tool designed to generate consistent datasets from any scenario run by the Global Change Analysis Model ([GCAM](http://www.globalchange.umd.edu/gcam/)), ensuring they meet the reporting standards of the Integrated Assessment Modeling Consortium ([IAMC](https://www.iamconsortium.org/)). In addition, `gcamreport` features an interactive user interface that allows users to create and download plots in real time and export reduced, formatted datasets in spreadsheet format. The tool is currently compatible with GCAM-core versions [6.0](https://zenodo.org/records/6619287), [7.0](https://zenodo.org/records/8010145), and [7.1](https://zenodo.org/records/11481167), as outlined in the [version guide](file:///C:/Users/claudia.rodes/Documents/IAM_COMPACT/gcamreport/docs/articles/Version_Guide.html). + +
@@ -85,15 +92,6 @@ devtools::install_github('bc3LC/gcamreport') Now `gcamreport` package is fully loaded. Enjoy! :smile: -**Note**:boom:: If you want to install specific `gcamreport` versions, indicate the tag or branch name when running the installation command. For instance: - -``` r -# to install the tagged version "v6.0.1" -devtools::install_github('bc3LC/gcamreport@v6.0.1') - -# to install the branch version "gcam-v6.0" -devtools::install_github('bc3LC/gcamreport@gcam-v6.0') -```
@@ -122,16 +120,6 @@ devtools::load_all() Now `gcamreport` package is fully loaded. Enjoy! :smile: -**Note**:boom:: If you want to install specific `gcamreport` versions, indicate the tag or branch name when cloning the repository. For instance: - -``` bash -# to clone the tagged version "v6.0.1": -git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git - -# to clone the branch version "gcam-v6.0": -git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git -``` -
@@ -188,15 +176,6 @@ Now `gcamreport` package is fully loaded. Enjoy! :smile: UI error -**Note**:boom:: If you want to install previous `gcamreport` versions, indicate the tag or branch name when cloning the repository (step 2). For instance: - -``` bash -# to clone the tagged version "v6.0.1": -git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git - -# to clone the branch version "gcam-v6.0": -git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git -```
@@ -216,7 +195,7 @@ The `gcamreport` package consists of a set of functions divided into two differe - Dataset generation: It creates or loads an existing project and automatically saves the generated dataset that meets the reporting requirements of the [IAMC](https://www.iamconsortium.org/). Main function: `generate_report()`. For more information, see this [tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html) or type `??generate_report` in your R console. If you get any warning or error messages, you might want to look at the [Warnings and Error Messages](#bugs) section. -- Interactive user block: it launches an interactive widget that displays the dataset in tabular form, with the ability to filter, reorder and download live. It also displays plots and allows them to be downloaded, aggregated by variables, regions and scenarios. Main function: `launch_gcamreport_ui()`. For more information see this [tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html) or type `??launch_gcamreport_ui` in your R console. If you get any warning or error messages, it might be useful to have a look at the [Warnings and Error Messages](#bugs) section. +- Interactive user block: it launches an interactive widget that displays the dataset in tabular form, with the ability to filter, reorder and download live. It also displays plots and allows them to be downloaded, aggregated by variables, regions and scenarios. Main function: `launch_gcamreport_ui()`. For more information see this [tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html) or type `??launch_gcamreport_ui` in your R console. If you get any warning or error messages, it might be useful to have a look at the [Top common Warnings and Error Messages](#bugs) section. The package also includes some default input files (.Rda) that are read by the different functions. These can be changed by the user as detailed in [this tutorial](https://bc3lc.github.io/gcamreport/articles/Modify_Mapping_Template_Tutorial.html). @@ -227,7 +206,7 @@ The package also includes some default input files (.Rda) that are read by the d -## Warnings and Error Messages +## Top common Warnings and Error Messages @@ -237,13 +216,14 @@ The package also includes some default input files (.Rda) that are read by the d Some typical and already-known errors that can be easily solved! :bulb: -:computer: Error on "run("path/to/your/data/myData.dat")" +:computer: Error on "generate_report(prj_name = "path/to/your/data/myData.dat")" In your R console, you might see this error: > generate_report("path/to/your/data/myData.dat") - [1] "Loading project..." - [1] "Loading data, performing checks, and saving output..." + Loading project... + Loading data, performing checks, and saving output... + [1] "ag_demand_clean" Error in rgcam::getQuery(prj, "demand balances by crop commodity") : getQuery: Query demand balances by crop commodity is not in any scenarios in the data set. @@ -276,6 +256,28 @@ This problem is due to a wrong path specification. Thus, make sure that you spec
+:computer: Error on "generate_report(...)" + +In your R console, you might see this error: + + > generate_report(...) + Loading project... + Loading data, performing checks, and saving output... + [1] "ag_demand_clean" + + Error in left_join_strict(., filter_variables(get(paste("ag_demand_map", : + Error: Some rows in the left dataset do not have matching keys in the right dataset. + +
+ +**Possible solution** + +This problem is due to a mismatch in the `ag_demand_map` map. Thus, make sure that you specified correctly the `GCAM_verions` parameter in the `generate_report` function. If the error persists, have a look at this [tutorial](https://bc3lc.github.io/gcamreport/articles/Modify_Mapping_Template_Tutorial.html#example-1-step-by-step-to-adapt-current-mappings-to-your-GCAM-version). + +
+ +
+ :computer: Wired message when launching the UI when using the Docker installation. After using the functions `generate_report()` or `launch_gcamreport_ui()` to launch the UI, you might get this message: diff --git a/_pkgdown.yml b/_pkgdown.yml index ee1bb1c5..18dc7f26 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -26,7 +26,9 @@ navbar: - text: Modify Mappings and Template Tutorial href: articles/Modify_Mapping_Template_Tutorial.html - text: ----- - - text: Documentation and tutorials for gcamreport v6.0* + - text: Depracted documentation and tutorials for gcamreport v7.0* + href: articles/gcamreport_v7-0.html + - text: Depracted documentation and tutorials for gcamreport v6.0* href: articles/gcamreport_v6-0.html - text: "Version Guide" icon: fa-solid fa-seedling diff --git a/examples/demo.R b/examples/demo.R deleted file mode 100644 index e40101c4..00000000 --- a/examples/demo.R +++ /dev/null @@ -1,82 +0,0 @@ - -################################################################################ -## -- example 1 - generate project - -rm(list = ls()) -devtools::load_all() - -## -- store the database path and name -dbpath <- "C:/Users/claudia.rodes/Documents/gcam-v7.0-Windows-Release-Package/output" -dbname <- "database_basexdb_ssp" - -## -- choose a project name -prjname <- "example1.dat" - -## -- generate the reporting dataset -generate_report(db_path = dbpath, db_name = dbname, prj_name = prjname, - final_year = 2050, - scenarios = c('GCAM_SSP4', 'GCAM_SSP5', 'GCAM_SSP1'), - desired_regions = c('USA', 'Brazil', 'EU-15'), - desired_variables = c('Agricultural*')) - - -available_regions() -available_variables() - - - - -################################################################################ -## -- example 2 - vetting - -rm(list = ls()) -devtools::load_all() - -## -- choose the project name -prjname <- "examples/prj_example_vetting.dat" - -## -- generate the reporting dataset -generate_report(prj_name = prjname, final_year = 2050) - - - - -################################################################################ -## -- example 3 - launch UI - - -## A) if "report" variable is in the environment -launch_gcamreport_ui(data = report) - - -## B) from an RData dataset -rm(list = ls()) -devtools::load_all() - -## -- set the Rproj path -RDataName <- "examples/prj_example_vetting_standardized.RData" - -## -- generate the reporting dataset -launch_gcamreport_ui(data_path = RDataName) - - - - -################################################################################ -## -- example 4 - saving options - launching UI options - error messages - -rm(list = ls()) -devtools::load_all() - -## -- set the project name -prjname <- "examples/example2.dat" - -## -- generate the reporting dataset -generate_report(prj_name = prjname, - final_year = 2050, - desired_regions = c('Argentina'), - desired_variables = c('Agricultral*'), - save_output = FALSE, - launch_ui = FALSE) - - diff --git a/examples/example2_standardized.RData b/examples/example2_standardized.RData deleted file mode 100644 index be50b6c248738c06ad88a6abcdaa67b7b7a11228..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1281 zcmV+c1^)UUiwFP!000002JP2%AlZ;Gz=500fr4YQsNfjF#@Gf1C9)&) zeikDt+5TBZlk4Z6-}7zqd!F7O_lW%?+zlfPX*Aj*8iP)LGs#<;zMsgA@5!gp7<%N0 zPGitmGgSgj!U+`_GABnSzJaVRmr*z%{vg5;^FQiV$s<`c4iW=MAh zFP`K)JE^;nc|@1aii!wamLgTjamDkdXFumAiE<1h%WM_fU+9`fER_F?Wg5+R=0Ekx z4mqP09%%qSSj8Kz_z?wHk4|*)3YUQ~8b{$&za^+@?z6GG>j}o6y45H+e-(VQ=Tf9g zYZmB;4KAv#8v?!3?D!egMqr+@;N%;Hjg-*mz7uEg^t_{BcB3!zR#PyzY3Lj2m@gZQ z4HkIs9yJD2UvCmN(+Mz6-SbLjGYj03dhu}Oz!lJ`rn>|gxCaKX^2b6F3c&nsPRVh; zKPB|3(P~naoB=TB&Y0g|?OWjHTN9yC;z3YeeRi^Px*Sw#*C}+n{#O7$Yn2Iwka(dqMs6XKmKter7%0!21hOle-^!XuP_@L->CAhz$KAQKX4=AGFxVX;348-1XFz6dM2e&6g=cxN*K)K44eyw>4 z80K)}2SNKspv#?T-yA^@D6Zgj>6e}Z3*Ppr^q7jGgg*0@*D>1;^?@3pM!R`Q1}I!( z)}yqV0u@WLIF?lxz%=^E-kO^mL3xKH`pU{AFf2<_Hlp_j`0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f6#Y!dDL=b#2>wDi#2TFt(jr z2odzGjFuUWGkGCo*Ybf6<587?B0E&!F_c3t{99yVH~zwfEr9M!71wgDaeoL6%A!`V z)LAYOxus=&O-jX~N7!SqhYJq8k)3U%VWePuZzJan;dk$8wXm|D&}6<7rY*}cgz$IH zg)r1B00400L9W#4yfPQ_2ZlPi<$60o_!OAG-Q7ZM3~Z)8MD*dL22C>T619BJ@3*)$ zB=@X)x0rL(AVD#{oNLpgK^jm0tu8czn{nxL4*;bAi2EkfAqdW|43)A^VO@lgBZ}}a zy|ybW5`epQ)`I4hL-cre8mFQBPSS1exj%Lm^{M_<`Ha&WF$wW}>=CXaNOQPQky7GE=h$LgBS#i)#C zuthR_!ddF3xOymIglrVT6fLNDsxq!9JJYp3u`1NZY9~`dmv3Xz1B43RKW>RsAKQ>Z{St{ i0002oMLMSd0qH!trUd|bu!2NBFb#_W000000a;oPMIq1t literal 0 HcmV?d00001 diff --git a/examples/example2.dat b/examples/example2_v7.0.dat similarity index 100% rename from examples/example2.dat rename to examples/example2_v7.0.dat diff --git a/examples/example2_v7.1.dat b/examples/example2_v7.1.dat new file mode 100644 index 0000000000000000000000000000000000000000..bc3dabc5df68401a5ca6e9e0fb93d4a8bc988775 GIT binary patch literal 15680 zcmV-GJ-@>JH+ooF0004LBHlIv03iV!0000G&sfak48A=CT>vQ&2UKVgRpfklJ zA8xfTSg5+gRN<6ySiP}!q-G_7k)F`Pi4Zb;mSm^=RN^zLxO?!5&?F$I7Ga8|%k2#r zK4O|wbjRBJ9R>WbcN#Uf=F&>2M7j9V$6-%y{X<&S7&!nd))0O%p zzSMHLEMsag`(Qzn31G8`euwOX7Q+NP9_gp13LoR#sc#Kpw-}R^)Dsa$)B8-4iq`{f zNi0@jZ?8U?VWKy^m4aJ3)&YcOFs(yS+{pm~M2NhLKcrXNWcVRuHswHUx7|tKfKeHB zCH4J11xH^%z7bM{(7cr;=&ueSkL1~@dTc4Sg54pk0}whaed<2;rxjD?k3FP+EmchL z^Ym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N;3(L# z=-sFd@0>?D4z)=rPe$%MR%#PWEt5kKT4f1f#SYO6NNWiidfpt4CAJ&9i0wgvP;@?! zgB+fz{_{k$T{b&eBOWiV?Y*@u_P=iHre^tWh4<=l+}TS(*RF{irk@)s*7a*YaJFMm z>U(s)c0fo#Omo|g5Hs)WD=aF}%qmpD3^NmVYQ2Seuq^OwjQm)|{YKmuG%An$&d1eP z4FmV4^*S%;>Rd<-=+ipJ84N^aPe9V}6iDz5O@xmM`i_7)mW15Q;so1 zCRR#uRAlP|EQ&@?7tDKW%nBCOvq6scx}3nC%HZ?eD<^Yw9k}L&ozkcGYwLk)4#u<8 zJ}de+b%>r8*!RV;N*{`7{`G(+8gbHFv=Uz?80)6y>~>M6#Y+ugX9-PpdZXc@Hp)^I zx~GGhxoCRBx!Kw_v;)T>nGN+XP#>wR9Y{qYOFhp3jL^Kl>uyZ&oMq?mFYfPP~N8miM)c0OV%l9^&y|Zd1yFfVOq?5UK4yd&^GQQGOz6aR6!JJ_~ zHXr155%HAB$P`&}AHl0y%Oo8C%sB9>6bgxi&EJdWZK&RY@TejdR!NT^kS5eJoTUhS z*#wMv2)|%tRUCQ?MBmn{$>4w9p|iv% z-a_DvMKDeZO2(-EKbXM(d!#1#0RDTlI8A%$fA>y0n`hAxoq5L=Ym3A2Q-uqJd~}^h zgK~@WjINwLC6=_kBLhP%@B7q=#uWTD`4Mu#SUi}66%Tv^>cUP%3PZfXVYMMh&N7Q* z;iSM^A)JG5MO2JfZ$=W{eRS6!FZo}snh{-9lt m>Iuxp;lKdV`$9JW0i1fjnG66lX!QX;Fb#_W000000a;qrCaj(S literal 0 HcmV?d00001 diff --git a/examples/example2_v7.1_standardized.RData b/examples/example2_v7.1_standardized.RData new file mode 100644 index 0000000000000000000000000000000000000000..144d640785fba759cce11421d30225d703246612 GIT binary patch literal 2775 zcmV;|3Mlm-iwFP!000002JM)8G?e)t$0wIcDr8GY$fa_d8Knq$yXJlwW=1X*V+>}P zY20P0R7zspx}a<&U4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(d5_n@T-#)b$001&Vg82Xd literal 0 HcmV?d00001 diff --git a/examples/example2_v7.1_standardized.csv b/examples/example2_v7.1_standardized.csv new file mode 100644 index 00000000..e262bae4 --- /dev/null +++ b/examples/example2_v7.1_standardized.csv @@ -0,0 +1,31 @@ +"Model","Scenario","Region","Variable","Unit","2005","2010","2015","2020","2025","2030","2035","2040","2045","2050" +"GCAM 7.1","Reference","EU-12","Agricultural Demand","million t DM/yr",194.8675436,188.9077729056,188.829033497,198.627245659,204.25751403,207.955752986,210.596100584,214.652285029,220.578827309,226.021468931 +"GCAM 7.1","Reference","EU-15","Agricultural Demand","million t DM/yr",778.5559588,843.1217764,896.1859449,927.3459385,947.5355257,964.4108166,979.5296163,1010.5429101,1066.5543082,1120.686132 +"GCAM 7.1","Reference","World","Agricultural Demand","million t DM/yr",973.4235024,1032.0295493056,1085.014978397,1125.973184159,1151.79303973,1172.366569586,1190.125716884,1225.195195129,1287.133135509,1346.707600931 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Crops","million t DM/yr",186.1210119,175.8001610056,171.664478897,181.441641259,187.10976033,190.910042786,193.719571884,197.978467029,204.120854309,209.793290731 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Crops","million t DM/yr",740.870096,782.1799386,810.7910049,840.2804285,858.9260457,874.3660966,888.1428063,917.8765101,972.7290082,1025.910612 +"GCAM 7.1","Reference","World","Agricultural Demand|Crops","million t DM/yr",926.9911079,957.9800996056,982.455483797,1021.722069759,1046.03580603,1065.276139386,1081.862378184,1115.854977129,1176.849862509,1235.703902731 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Crops|Energy","million t DM/yr",0.4553754,7.68468,8.20439,11.38611,11.59661,10.94375,10.61851,13.16762,18.76255,24.23309 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Crops|Energy","million t DM/yr",14.96868,53.82655,55.76533,63.413,61.4444,55.71416,49.26446,62.37799,105.78372,148.1708 +"GCAM 7.1","Reference","World","Agricultural Demand|Crops|Energy","million t DM/yr",15.4240554,61.51123,63.96972,74.79911,73.04101,66.65791,59.88297,75.54561,124.54627,172.40389 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Crops|Feed","million t DM/yr",53.9681684,49.35493,49.4814446,53.14205683,56.70827426,59.99534316,62.66563073,64.41191158,65.36476083,66.24372933 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Crops|Feed","million t DM/yr",180.37992,186.5594504,205.5625233,213.4213926,221.446377,230.5852589,239.3080324,244.7653914,245.9720382,247.8718264 +"GCAM 7.1","Reference","World","Agricultural Demand|Crops|Feed","million t DM/yr",234.3480884,235.9143804,255.0439679,266.56344943,278.15465126,290.58060206,301.97366313,309.17730298,311.33679903,314.11555573 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Crops|Food","million t DM/yr",79.7097638,82.4242094056,84.472489397,87.523177129,89.59528197,91.036852026,91.878933554,92.265666649,92.292849379,92.060930601 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Crops|Food","million t DM/yr",332.24148,353.9580072,366.4228606,377.3616519,387.0866127,396.5005737,405.6060349,414.5697397,422.898128,430.2779866 +"GCAM 7.1","Reference","World","Agricultural Demand|Crops|Food","million t DM/yr",411.9512438,436.3822166056,450.895349997,464.884829029,476.68189467,487.537425726,497.484968454,506.835406349,515.190977379,522.338917201 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Crops|Other","million t DM/yr",51.9877043,36.3363416,29.5061549,29.3902973,29.2095941,28.9340976,28.5564976,28.1332688,27.7006941,27.2555408 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Crops|Other","million t DM/yr",213.280016,187.835931,183.040291,186.084384,188.948656,191.566104,193.964279,196.163389,198.075122,199.589999 +"GCAM 7.1","Reference","World","Agricultural Demand|Crops|Other","million t DM/yr",265.2677203,224.1722726,212.5464459,215.4746813,218.1582501,220.5002016,222.5207766,224.2966578,225.7758161,226.8455398 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Livestock","million t DM/yr",8.7465317,13.1076119,17.1645546,17.1856044,17.1477537,17.0457102,16.8765287,16.673818,16.457973,16.2281782 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Livestock","million t DM/yr",37.6858628,60.9418378,85.39494,87.06551,88.60948,90.04472,91.38681,92.6664,93.8253,94.77552 +"GCAM 7.1","Reference","World","Agricultural Demand|Livestock","million t DM/yr",46.4323945,74.0494497,102.5594946,104.2511144,105.7572337,107.0904302,108.2633387,109.340218,110.283273,111.0036982 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Livestock|Food","million t DM/yr",1.84219,1.67212,1.49107,1.57358,1.63179,1.67604,1.70746,1.72952,1.74345,1.75011 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Livestock|Food","million t DM/yr",12.2127,12.853,13.1261,13.5948,14.0078,14.4097,14.8049,15.2161,15.6203,15.9724 +"GCAM 7.1","Reference","World","Agricultural Demand|Livestock|Food","million t DM/yr",14.05489,14.52512,14.61717,15.16838,15.63959,16.08574,16.51236,16.94562,17.36375,17.72251 +"GCAM 7.1","Reference","EU-12","Agricultural Demand|Livestock|Other","million t DM/yr",6.9043417,11.4354919,15.6734846,15.6120244,15.5159637,15.3696702,15.1690687,14.944298,14.714523,14.4780682 +"GCAM 7.1","Reference","EU-15","Agricultural Demand|Livestock|Other","million t DM/yr",25.4731628,48.0888378,72.26884,73.47071,74.60168,75.63502,76.58191,77.4503,78.205,78.80312 +"GCAM 7.1","Reference","World","Agricultural Demand|Livestock|Other","million t DM/yr",32.3775045,59.5243297,87.9423246,89.0827344,90.1176437,91.0046902,91.7509787,92.394598,92.919523,93.2811882 +"GCAM 7.1","Reference","EU-12","Agricultural Production","million t DM/yr",261.100875310439,269.429300007827,295.924825081362,314.769265185606,328.598012061418,340.760570149419,352.641660229703,365.718905244915,380.173780898525,392.565210168238 +"GCAM 7.1","Reference","EU-15","Agricultural Production","million t DM/yr",1006.44709633724,1077.53479630048,1121.23536874784,1191.4805877856,1242.89189631569,1299.08484918447,1340.18849048944,1394.5952603443,1463.58228544982,1516.49748014357 +"GCAM 7.1","Reference","World","Agricultural Production","million t DM/yr",1267.54797164768,1346.9640963083,1417.1601938292,1506.24985297121,1571.48990837711,1639.84541933389,1692.83015071914,1760.31416558921,1843.75606634835,1909.0626903118 diff --git a/examples/example2_v7.1_standardized.xlsx b/examples/example2_v7.1_standardized.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..ed7a3819b3dad9c66f6f9314766518cd01249c48 GIT binary patch literal 8983 zcmZ`<1yCGYmj;5nyL)hFfIzSzI0V-aWN;ZQI3c)0aCg@LVQ_~)a0w6yKDfIC+j;-n zt+y|=J5$}arfa@)yS{VIJ$=vD>PjyV3E|-2P+F90BZ#p^THG z8_3bkM9T{day91ibg-{Z9C7TU#Rc9xqW44i7>%{GiCCf}QXGi)P}E5WSxIsE6%xC+ zA&K(U)31^oqequocCZ7dES3R~z+j=<1e}2Y{!>xXgB_;lv<_mNEV`FYNf^|Mo$#B9 zXJgiohyV^@9}X`SLYiV(W0^wrU{nd+igM%ZXhl7F{b2ofPJ~5CWM#YtCdT?N6TV5+GJzxO zZTz-v6O1+4vWtN3$~OaPl4MozWzGe{;!-8Pxp~jnwc8#-ECD8ToDwp64>wQFK(kPT4olI=w@`JXpAZB4>~@Hh?m5Su|bJ-KHRYyIT(8tvmc{z zO^L}-Nlu6~G9EVGJ@RDZjKhY39L9jc2QI?Q+_rpFW>75u-VvuyBtL}g{rNV}9U`uh z#vV&JtTtjJ{c_^RUigRZ*vpEV6Sv>r1Ga<9A>)#ZtxRQ)ywigAj)qQqpN~unXsrw$ zhFL9?sUkjk{W!@A)!oi#Q=i;1)|qd65HHPsNv8yHo?djN@(GmkG^raG4sJ~i4vzG1GXA2$)fxnHbLIZe!21^;#YPK`6mN+Aa%*WX zb2N^WXxUFarxbbRnbWNdY!_r1r)h0`5H_JZg!;3b%lo#UlW-9eCR%10?|&FqdYz9v zQ`5+;W^UO+(z-cC zbI|N=eqU*(>W$v}PH)#sP{-5ni?g%+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x+*f$G76)w5c40j>5L{#oHsS6ogcB1mbjnJarvTJww4lX3W{uhcHKxutq zGk@DDxGMOZXP7V%wmo5*!s{4>QyPtn?5Lp25RQ~uzeH@8(*70Nr;&Krw|=7O0+`HF z>Rg#siJNzm zZ;knhf~&P3bF(wopSx?_55b{@`5Ae;kUe9gM{%_;f|Hshn&dVkjro%Z9959X2(<9t zGzR)r3*w{%+u+5Y6aCCt6U%4yP2=l3!j2CLriMD-cCLfMZx6Z>M=0q)5|Kz2T9dNBo+@ zJ5yCd_GE?G`=7PztNdg^G~L#x9r74t->^rtr=ahKq};m%&k&n4KD0!GKxQ2|iXLm5Byg|-{h8)^HDTEmL?_F$s z1cGse(J>GFkmY>i%A>;DFf{(xh)_ zv6cwmeb@D^EFW~y4!fxRWr%C%?~yGpz-r3(3Wmonz}TFvtbauhK`&dZa}1Kf@t%Be zRay^7i-KEU9wdN%bkEGaOBcZVoXNHoqETjpgm8KXuMNcB=HSB?)gYJkg;2-yp!2%M z>v2*W+>Zykg_bsh?lv@7Tj_ALZ+h^5>26=Z*5`kMie_@(oD8%O=6+M(d5_n@T-#)b$001&Vg82Xd literal 0 HcmV?d00001 diff --git a/man/launch_gcamreport_ui.Rd b/man/launch_gcamreport_ui.Rd index 3b4f4307..620f8819 100644 --- a/man/launch_gcamreport_ui.Rd +++ b/man/launch_gcamreport_ui.Rd @@ -4,12 +4,14 @@ \alias{launch_gcamreport_ui} \title{launch_gcamreport_ui} \usage{ -launch_gcamreport_ui(data_path = NULL, data = NULL) +launch_gcamreport_ui(data_path = NULL, data = NULL, GCAM_version = "v7.0") } \arguments{ \item{data_path}{Optional. Path to an RData file containing the standardized data. If provided, this file will be used to load the data into the Shiny application. You can obtain this dataset using `gcamreport::generate_report`.} \item{data}{Optional. An R dataframe or list containing the standardized data. If provided, this data will be used directly in the Shiny application. You can obtain this dataset using `gcamreport::generate_report`.} + +\item{GCAM_version}{Main GCAM compatible version: 'v7.0' (default), 'v7.1', or 'v6.0'.} } \value{ Launches the Shiny interactive UI. This function does not return a value but starts the Shiny application for user interaction. diff --git a/vignettes/Dataset_Generation_Tutorial.Rmd b/vignettes/Dataset_Generation_Tutorial.Rmd index e15a4fb7..9b919c66 100644 --- a/vignettes/Dataset_Generation_Tutorial.Rmd +++ b/vignettes/Dataset_Generation_Tutorial.Rmd @@ -21,7 +21,7 @@ To see a formal description of the `generate_report()` function, look [here](htt ## Example 1: generate a dataset from a database {#example1} -Suppose you have a database named `myDb` in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios: `scen1`, `scen2` and `scen3` using a `new_general_queries_file`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. +Suppose you have a database from GCAM version *v7.1* named `myDb` in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios: `scen1`, `scen2` and `scen3`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. @@ -38,13 +38,14 @@ and if you are using R, run library(gcamreport) ``` -3) Store the database path and name, the query path, the desired project name, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). If you want to specify the query files, look at the [query files tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-6-specify-the-query-files). +3) Store the database path and name, the query path, the desired project name, the GCAM-core compatible version, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). If you want to specify the GWP version look at [GWP tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-6-specify-the-GWP-or-GCAM-version) and if you want to specify the query files, look at the [query files tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-7-specify-the-query-files). ``` r dbpath <- "/path/to/database" dbname <- "gcamdb_name" prjname <- "awesomeProj.dat" scen <- c("scen1", "scen2", "scen3") +GCAMv <- "v7.1" ``` Notice that the extension is included in the project name. Accepted extensions are `.dat` & `.proj`. @@ -52,11 +53,12 @@ Notice that the extension is included in the project name. Accepted extensions a **Note**: If you followed the Docker installation, you should place your database inside the `gcamreport` folder, which is now considered the root of the R session. Inside the R session it is referred to as `/app`. Thus, your database path will be something like `/app/path/to/database`. -4) Generate the standardized standardized dataset until the desired year. In this example, 2050. By default is 2100 and it should be at least 2025. +4) Generate the standardized dataset until the desired year. In this example, 2050. By default is 2100 and it should be at least 2025. ``` r generate_report(db_path = dbpath, db_name = dbname, prj_name = prjname, - scenarios = scen, final_year = 2050, launch_ui = FALSE) + GCAM_version = GCAMv, scenarios = scen, final_year = 2050, + launch_ui = FALSE) ``` **Note**: The project generation might take some time, depending on the number of scenarios, regions, and variables you want to standardize. @@ -65,7 +67,7 @@ Notice that the dataset will automatically be saved in `.RData`, `.csv` and `.xl This procedure will also generate a project file at `/path/to/database/dbname_prjname.dat` with all the loaded queries. You can directly use it as indicated in [Example 2](#example2). -The terminal will output the performed vetting verifications and their final status. +The terminal will output the performed vetting verification and their final status. newline @@ -80,7 +82,7 @@ The terminal will output the performed vetting verifications and their final sta ## Example 2: generate a dataset from a project {#example2} -Suppose you have a project named `myProj.dat` and you want to generate a standardized dataset from it. The `generate_report` function will generate it and automatically save it in the same folder as `myProj.dat`. Note that `myProj.dat` should have all the queries needed to generate the standardized dataset. If you are not sure you have all of them, or if you need to generate the project, see [Example1](#example1). +Suppose you have a project named `myProj.dat` obtained through GCAM 7.1 and you want to generate a standardized dataset from it. The `generate_report` function will generate it and automatically save it in the same folder as `myProj.dat`. Note that `myProj.dat` should have all the queries needed to generate the standardized dataset. If you are not sure you have all of them, or if you need to generate the project, see [Example1](#example1). 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. @@ -97,12 +99,13 @@ and if you are using R, run library(gcamreport) ``` -3) Store the project path and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). Notice that only regions and variables already present in the rgcam project can be considered for reporting. If you wish to include new items in your project, consider generating the project again as detailed in [Example1](#example1). +3) Store the project path, the GCAM version, the desired scenarios, and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). Notice that only regions and variables already present in the rgcam project can be considered for reporting. If you wish to include new items in your project, consider generating the project again as detailed in [Example1](#example1). ``` r mypath <- "/path/to/project/myProj.dat" scen <- c('scen1', 'scen2', 'scen3') +GCAMv <- "v7.1" ``` Notice that the extension is included. Accepted extensions are `.dat` & `.proj`. @@ -113,7 +116,7 @@ Notice that the extension is included. Accepted extensions are `.dat` & `.proj`. ``` r generate_report(prj_name = mypath, scenarios = scen, final_year = 2050, - launch_ui = FALSE) + GCAM_version = GCAMv, launch_ui = FALSE) ``` Notice that the dataset will automatically be saved in `.RData`, `.csv` and `.xlsx` at `/path/to/project/myProj_standardized.RData`, `/path/to/project/myProj_standardized.csv`, and `/path/to/project/myProj_standardized.xlsx`. @@ -287,13 +290,55 @@ In case you specify only some variables within a group, they will make up the to -## Example 6: specify the query files + +## Example 6: specify the GWP or the GCAM version + +Suppose you are in the situation of one of the previous examples, but you want to consider some specific GWP values to standardize the dataset, which is from a certain GCAM version. + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Check which are the available GWP and CAM versions for reporting. The following command will print a list with all the possibilities. + +``` r +available_GCAM_versions() +available_GWP_versions() +``` + + +4) Use [example1](#example1) database or [example2](#example2) project description and add all the extra parameters that you consider in the `generate_report` function (e.g, final year, desired scenarios...). Specify the GWP version through the `GWP_version` parameter and the GCAM version through the `GCAM_version` parameter. Notice that the GCAM version should match the GCAM version used to produce the data. By default +the reporting process uses GCAM7.0 and AR5. + +```r +## -- specify the desired variables +generate_report(..., GCAM_version = "v6.0", GWP_version = "AR4") +``` + +newline + + + + + +## Example 7: specify the query files The `gcamreport` standardization procedure requires two query files. The `gcamreport::queries_general` is a query file that contains the necessary queries to standardize any variable. You can see the xml version of this file [here](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/inst/extdata/queries/queries_gcamreport_gcam7.0_general.xml). In contrast, the `gcamreport::queries_nonCO2` contains only _nonCO2_ queries. In particular, the queries `nonCO2 emissions by sector (excluding resource production` and `nonCO2 emissions by region`. These queries are particularly heavy, and to avoid crashing the R session, they are loaded in parts. You can see the xml version of the file [here](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/inst/extdata/queries/queries_gcamreport_gcam7.0_nonCO2.xml). It is highly recommended not to modify these files. Although they specify a large set of queries to be loaded, not all of them will be included in the rgcam project. The `gcamreport` package generates the rgcam project with the minimum queries necessary to standardize the desired variables, thus avoiding loading extra queries. It is only possible to specify the query files when generating the rgcam project. -Let's start with the example: Suppose you have a database named `myDb` in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios (`scen1`, `scen2` and `scen3`) using a `new_general_queries_file`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. +Let's start with the example: Suppose you have a database named `myDb` of GCAM 7.1 in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios (`scen1`, `scen2` and `scen3`) using a `new_general_queries_file`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. @@ -310,13 +355,14 @@ and if you are using R, run library(gcamreport) ``` -3) Store the database path and name, the general query path, the desired project name, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). +3) Store the database path and name, the general query path, the desired project name, the GCAM version, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). ``` r dbpath <- "/path/to/database" dbname <- "gcamdb_name" prjname <- "awesomeProj.dat" scen <- c("scen1", "scen2", "scen3") +GCAMv <- "v7.1" new_queries_general_file <- "path/to/your/new_queries_file.xml" ``` @@ -330,7 +376,8 @@ Notice that the extension is included in the general query file (`.xml`) and in ``` r generate_report(db_path = dbpath, query_path = querypath, db_name = dbname, prj_name = prjname, scenarios = scen, final_year = 2050, - launch_ui = FALSE, queries_general_file = new_queries_general_file) + GCAM_version = GCAMv, launch_ui = FALSE, + queries_general_file = new_queries_general_file) ``` **Note**: The project generation might take some time, depending on the number of scenarios, regions, and variables you want to standardize. @@ -356,10 +403,8 @@ To specify the _nonCO2_ query file you can proceed analogously. However, check c #### A) Error on `generate_report` considering a database -When running `generate_report(db_path = "path/to/your/database", db_name = "database_name", prj_name = "project_name.dat")`, you might see this error in your R console: - +When running `generate_report(db_path = "path/to/your/data/myData.dat"")`, you might see this error in your R console: -When running `generate_report("path/to/your/data/myData.dat")`, you might see this error in your R console: > generate_report("path/to/your/data/myData.dat") [1] "Creating project..." @@ -373,19 +418,19 @@ When running `generate_report("path/to/your/data/myData.dat")`, you might see th This problem might be due to an incorrect package installation or an incorrect database placement. -**Possible solution 1**: make sure that you cloned the repo. Check the instructions [here](https://bc3lc.github.io/gcamreport/index.html#installation-guide). +**Possible solution 1**: ensure that you cloned the repo. Check the instructions [here](https://bc3lc.github.io/gcamreport/index.html#installation-guide). -**Possible solution 2**: make sure that you placed the database in the folder you are specifying. It can be, that if you extracted the database from a zip folder, an intermediate folder has appeared. In addition: +**Possible solution 2**: ensure that you placed the database in the folder you are specifying. It can be, that if you extracted the database from a zip folder, an intermediate folder has appeared. In addition: - In case you are using the `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `db_path = C:\Users\username\Documents\path\to\your\database` if you are using a Windows distribution. - In case you are using the `gcamreport` package following the [Docker installation](#with-docker): - a) make sure that your database is inside the `gcamreport` folder. + a) ensure that your database is inside the `gcamreport` folder. - b) make sure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) + b) ensure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) - c) make sure that you are pointing correctly to your database. For example, if in the `gcamreport` folder you have a folder called `some_databases` with your database `amazingDatabase`, you should refer to it as + c) ensure that you are pointing correctly to your database. For example, if in the `gcamreport` folder you have a folder called `some_databases` with your database `amazingDatabase`, you should refer to it as ``` r # option 1: full path @@ -394,6 +439,36 @@ generate_report(db_path = "/app/some_databases", db_name = "amazingDatabase") # option 2: partial path generate_report(db_path = "some_databases", db_name = "amazingDatabase") ``` + +**Possible solution 3**: ensure that you **did not** place the database in the main `gcamreport` folder. The database should be placed in any subfolder within `gcamreport` or in any folder outside `gcamreport`. Due tot a known issue with the `rgcam` package, placing the database in the man folder is not supported. + +newline + + + + + + + +#### B) Error on `generate_report` with `left_join_strict` + +When running `generate_report()`, you might see this error in your R console: + + > generate_report(...) + Loading project... + Loading data, performing checks, and saving output... + [1] "ag_demand_clean" + + Error in left_join_strict(., filter_variables(get(paste("ag_demand_map", : + Error: Some rows in the left dataset do not have matching keys in the right dataset. + + +This problem is due to a mismatch in the `ag_demand_map` map. + +**Possible solution 1**: ensure that you specified correctly the `GCAM_verions` parameter in the `generate_report` function. + +**Possible solution 2**: have a look at this [tutorial](https://bc3lc.github.io/gcamreport/articles/Modify_Mapping_Template_Tutorial.html#example-1-step-by-step-to-adapt-current-mappings-to-your-GCAM-version) to know more about how to update the mappings. + newline @@ -402,7 +477,7 @@ generate_report(db_path = "some_databases", db_name = "amazingDatabase") -#### B) Error on `generate_report` considering a project +#### C) Error on `generate_report` considering a project When running `generate_report("path/to/your/data/myData.dat")`, you might see this error in your R console: @@ -415,17 +490,17 @@ When running `generate_report("path/to/your/data/myData.dat")`, you might see th This problem is due to a wrong path specification. -**Possible solution**: make sure that you specified correctly the path. In addition: +**Possible solution**: ensure that you specified correctly the path. In addition: - In case you are using the `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `C:\Users\username\Documents\path\to\your\data\myData.dat` if you are using a Windows distribution. - In case you are using the `gcamreport` package following the [Docker installation](#with-docker): - a) make sure that your data is inside the `gcamreport` folder. + a) ensure that your data is inside the `gcamreport` folder. - b) make sure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) + b) ensure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) - c) make sure that you are pointing correctly to your data. For example, if in the `gcamreport` folder you have a folder called `amazingData` with your dataset `myData.dat`, you should refer to it as + c) ensure that you are pointing correctly to your data. For example, if in the `gcamreport` folder you have a folder called `amazingData` with your dataset `myData.dat`, you should refer to it as ``` r # option 1: full path @@ -441,7 +516,7 @@ generate_report("amazingData/myData.dat") -#### C) Error related to *system* when using the Docker installation. +#### D) Error related to *system* when using the Docker installation. Once the R console is opened, you might see this message after introducing any command: diff --git a/vignettes/Dataset_Generation_Tutorial_v7-0.Rmd b/vignettes/Dataset_Generation_Tutorial_v7-0.Rmd new file mode 100644 index 00000000..48d5904c --- /dev/null +++ b/vignettes/Dataset_Generation_Tutorial_v7-0.Rmd @@ -0,0 +1,455 @@ +--- +title: "Dataset Generation Tutorial for gcamreport v7.0*" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Dataset_Generation_Tutorial_v7-0} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + + **ATTENTION**: this tutorial is compatible with `gcamreport v7.0*`, i.e, with `gcamreport v7.0.0` and `gcamreport v7.0.1` releases. For other releases, please check in the *Tutorials* drop-down menu in the main bar. + +newline + + + + + + + + + + +## Example 1: generate a dataset from a database {#example1} + +Suppose you have a database named `myDb` in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios: `scen1`, `scen2` and `scen3` using a `new_general_queries_file`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Store the database path and name, the query path, the desired project name, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). If you want to specify the query files, look at the [query files tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-6-specify-the-query-files). + +``` r +dbpath <- "/path/to/database" +dbname <- "gcamdb_name" +prjname <- "awesomeProj.dat" +scen <- c("scen1", "scen2", "scen3") +``` + +Notice that the extension is included in the project name. Accepted extensions are `.dat` & `.proj`. + +**Note**: If you followed the Docker installation, you should place your database inside the `gcamreport` folder, which is now considered the root of the R session. Inside the R session it is referred to as `/app`. Thus, your database path will be something like `/app/path/to/database`. + + +4) Generate the standardized standardized dataset until the desired year. In this example, 2050. By default is 2100 and it should be at least 2025. + +``` r +generate_report(db_path = dbpath, db_name = dbname, prj_name = prjname, + scenarios = scen, final_year = 2050, launch_ui = FALSE) +``` + +**Note**: The project generation might take some time, depending on the number of scenarios, regions, and variables you want to standardize. + +Notice that the dataset will automatically be saved in `.RData`, `.csv` and `.xlsx` at `/path/to/database/awesomeProj_standardized.RData`, `/path/to/database/awesomeProj_standardized.csv`, and `/path/to/database/awesomeProj_standardized.xlsx`. + +This procedure will also generate a project file at `/path/to/database/dbname_prjname.dat` with all the loaded queries. You can directly use it as indicated in [Example 2](#example2). + +The terminal will output the performed vetting verifications and their final status. + +newline + + + + + + + + + + +## Example 2: generate a dataset from a project {#example2} + +Suppose you have a project named `myProj.dat` and you want to generate a standardized dataset from it. The `generate_report` function will generate it and automatically save it in the same folder as `myProj.dat`. Note that `myProj.dat` should have all the queries needed to generate the standardized dataset. If you are not sure you have all of them, or if you need to generate the project, see [Example1](#example1). + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Store the project path and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). Notice that only regions and variables already present in the rgcam project can be considered for reporting. If you wish to include new items in your project, consider generating the project again as detailed in [Example1](#example1). + + +``` r +mypath <- "/path/to/project/myProj.dat" +scen <- c('scen1', 'scen2', 'scen3') +``` + +Notice that the extension is included. Accepted extensions are `.dat` & `.proj`. + +**Note**: If you followed the Docker installation, you should place your project file inside the `gcamreport` folder, which is now considered the root of the R session. Inside the R session it is referred to as `/app`. Thus, your project path will be something like `/app/path/to/project/myProj.dat`. + +4) Generate the standardized dataset until the desired year. In this example, 2050. By default is 2100 and it should be at least 2025. + +``` r +generate_report(prj_name = mypath, scenarios = scen, final_year = 2050, + launch_ui = FALSE) +``` + +Notice that the dataset will automatically be saved in `.RData`, `.csv` and `.xlsx` at `/path/to/project/myProj_standardized.RData`, `/path/to/project/myProj_standardized.csv`, and `/path/to/project/myProj_standardized.xlsx`. + +The terminal will output the performed verifications and their final status. + + +newline + + + + + + + + + + + +## Example 3: save or not the output and specify the file format or the directory + +Suppose you are in the situation of one of the previous examples, but you want to either not save the standardized output, save it in `.csv`, `.xlsx`, or in both extensions. + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Use [example1](#example1) database or [example2](#example2) project description and add all the extra parameters that you would like to consider in the `generate_report` function (e.g., final year, desired scenarios...). Specify the output saving options through the `save_output` parameter: + +```r +## -- save the dataset in CSV and XLSX format +generate_report(..., save_output = TRUE) # this is the default option + +## -- save the dataset only in CSV format +generate_report(..., save_output = 'CSV') + +## -- save the dataset only in XLSX format +generate_report(..., save_output = 'XLSX') + +## -- do not save the dataset +generate_report(..., save_output = FALSE) +``` + + + +4) Use [example1](#example1) database or [example2](#example2) project description and add all the extra parameters that you consider in the `generate_report` function. Specify the output directory and output file name through `output_file` parameter. This will save the output in the indicated path as `.csv` and `.xlsx`. To modify the extension, check step 3. + +```r +## -- save the dataset in '/desired/directory' and in a file called 'awesomeOutput' +generate_report(..., output_file = '/desired/directory/awesomeOutput') +``` +newline + + + + + +## Example 4: specify the regions or regions' group/s + +Suppose you are in one of the previous situations, but you want to consider a standardized dataset with only some regions. You have two ways to select them: you can directly specify the desired regions to be considered, or you can specify the group(s) of regions to be considered. In either case, the desired regions will form *World*. Then, for example, the total arable land of the world will be the sum of the arable land of **only** the selected regions. + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Check which are the available regions or regions' groups for reporting. The following commands will print a list with all the possibilities. + +``` r +available_regions() +available_continents() +``` +In case you want to store them in a vector, you can simply assign the output. You can also skip the console printing by setting `print = FALSE`. + +``` r +avail_reg <- available_regions(print = FALSE) +avail_cont <- available_continents() +``` + + +4) Use [example1](#example1) database or [example2](#example2) project description and add all the extra parameters that you consider in the `generate_report` function (e.g., final final, desired scenarios...). Specify the regions through the `desired_regions` parameter or the `desired_continents` parameter. Notice that not both can be specified at the same time. + +```r +## -- specify the desired regions +generate_report(..., desired_regions = c('EU-15','EU-12')) + +## -- specify the desired regions' group/s +generate_report(..., desired_continents = c('ASIA','REF')) +``` + +newline + + + + + + +## Example 5: specify the variables + +Suppose you are in the situation of one of the previous examples, but you want to consider only some variables in the standardized dataset. + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Check which are the available variables for reporting. The following command will print a list with all the possibilities. + +``` r +available_variables() +``` +In case you want to save them in a vector, you can simply assign the output. You can also skip the console printing by setting `print = FALSE`. + +``` r +avail_var <- available_variables(print = FALSE) +``` + + +4) Use [example1](#example1) database or [example2](#example2) project description and add all the extra parameters that you consider in the `generate_report` function (e.g, final year, desired scenarios...). Specify the variables through the `desired_variables` parameter. You can specify a vector with all the desired variables names fully written, or also consider all variables that start with the same name. This last feature, allows you to easily select all variables within a group, such as *Emissions*, *Emissions|CO2*, or *Agricultural Demand* + +```r +## -- specify the desired variables +generate_report(..., + desired_variables = c('Agricultural Demand|Crops|Energy', + 'Agricultural Demand|Crops|Feed', + 'Capacity Additions|Electricity|Wind|Onshore', + 'Emissions|BC|Energy*')) # This will select, + # Emissions|BC|Energy, + # Emissions|BC|Energy|Demand|Industry, + # Emissions|BC|Energy|Demand|Residential and Commercial, + # Emissions|BC|Energy|Demand|Transportation, + # Emissions|BC|Energy|Supply +``` + +In case you specify only some variables within a group, they will make up the total value. For example, if we select *Final Energy|Electricity* and *Final Energy|Gases*, then *Final Energy* will be the sum of these two sectors, and will not consider *Final Energy|Industry* or *Final Energy|Heat*. + +newline + + + + + + +## Example 6: specify the query files + +The `gcamreport` standardization procedure requires two query files. The `gcamreport::queries_general` is a query file that contains the necessary queries to standardize any variable. You can see the xml version of this file [here](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/inst/extdata/queries/queries_gcamreport_gcam7.0_general.xml). In contrast, the `gcamreport::queries_nonCO2` contains only _nonCO2_ queries. In particular, the queries `nonCO2 emissions by sector (excluding resource production` and `nonCO2 emissions by region`. These queries are particularly heavy, and to avoid crashing the R session, they are loaded in parts. You can see the xml version of the file [here](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/inst/extdata/queries/queries_gcamreport_gcam7.0_nonCO2.xml). + +It is highly recommended not to modify these files. Although they specify a large set of queries to be loaded, not all of them will be included in the rgcam project. The `gcamreport` package generates the rgcam project with the minimum queries necessary to standardize the desired variables, thus avoiding loading extra queries. It is only possible to specify the query files when generating the rgcam project. + +Let's start with the example: Suppose you have a database named `myDb` in a folder named `dbFolder` and you want to generate a standardized dataset for several scenarios (`scen1`, `scen2` and `scen3`) using a `new_general_queries_file`. The `generate_report` function will generate it and automatically save it in the same folder where `myDb` is located. + + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +3) Store the database path and name, the general query path, the desired project name, and the desired scenarios and reporting variables in variables. In case you do not specify the scenarios, all the scenarios in the database will be considered for reporting; and if the variables are not specified, all the available reporting variables will be used. For more details about scenarios and variables specification, look at the [regions' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-4-specify-the-regions-or-regions-groups) or at the [variables' tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-5-specify-the-variables). + +``` r +dbpath <- "/path/to/database" +dbname <- "gcamdb_name" +prjname <- "awesomeProj.dat" +scen <- c("scen1", "scen2", "scen3") +new_queries_general_file <- "path/to/your/new_queries_file.xml" +``` + +Notice that the extension is included in the general query file (`.xml`) and in the project name (`.dat` or `.proj`). + +**Note**: If you followed the Docker installation, you should place your database and the new query file inside the `gcamreport` folder, which is now considered the root of the R session. Inside the R session it is referred to as `/app`. Thus, your databse path will be something like `/app/path/to/database` and your query file path will be something like `/app/path/to/new_queries_file.xml`. + + +4) Generate the standardized dataset until the desired year. In this example, 2050. By default is 2100 and it should be at least 2025. + +``` r +generate_report(db_path = dbpath, query_path = querypath, db_name = dbname, + prj_name = prjname, scenarios = scen, final_year = 2050, + launch_ui = FALSE, queries_general_file = new_queries_general_file) +``` + +**Note**: The project generation might take some time, depending on the number of scenarios, regions, and variables you want to standardize. + +Notice that the dataset will automatically be saved in `.RData`, `.csv` and `.xlsx` at `/path/to/database/awesomeProj_standardized.RData`, `/path/to/database/awesomeProj_standardized.csv`, and `/path/to/database/awesomeProj_standardized.xlsx`. + +This procedure will also generate a project file at `/path/to/database/dbname_prjname.dat` with all the loaded queries. You can directly use it as indicated in [Example 2](#example2). + +The terminal will output the performed vetting verifications and their final status. + + +To specify the _nonCO2_ query file you can proceed analogously. However, check carefully its default structure and the function where is used: [data_query](file:///C:/Users/claudia.rodes/Documents/IAM_COMPACT/gcamreport/docs/reference/data_query.html). + + +newline + + + + + + +## Troubleshooting for the `generate_report()` function + +#### A) Error on `generate_report` considering a database + +When running `generate_report(db_path = "path/to/your/database", db_name = "database_name", prj_name = "project_name.dat")`, you might see this error in your R console: + + +When running `generate_report("path/to/your/data/myData.dat")`, you might see this error in your R console: + + > generate_report("path/to/your/data/myData.dat") + [1] "Creating project..." + /home/user/basex/.basex: writing new configuration file. + Error in localDBConn(db_path, db_name, migabble = FALSE) : + Database does not exist or is invalid: examples/database_basexdb_ref + In addition: Warning messages: + 1: In normalizePath(dbPath) : + path[1]="examples": No such file or directory + 2: The following named parsers don't match the column names: name, date, version + +This problem might be due to an incorrect package installation or an incorrect database placement. + +**Possible solution 1**: make sure that you cloned the repo. Check the instructions [here](https://bc3lc.github.io/gcamreport/index.html#installation-guide). + +**Possible solution 2**: make sure that you placed the database in the folder you are specifying. It can be, that if you extracted the database from a zip folder, an intermediate folder has appeared. In addition: + +- In case you are using the `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `db_path = C:\Users\username\Documents\path\to\your\database` if you are using a Windows distribution. + +- In case you are using the `gcamreport` package following the [Docker installation](#with-docker): + + a) make sure that your database is inside the `gcamreport` folder. + + b) make sure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) + + c) make sure that you are pointing correctly to your database. For example, if in the `gcamreport` folder you have a folder called `some_databases` with your database `amazingDatabase`, you should refer to it as + +``` r +# option 1: full path +generate_report(db_path = "/app/some_databases", db_name = "amazingDatabase") + +# option 2: partial path +generate_report(db_path = "some_databases", db_name = "amazingDatabase") +``` +newline + + + + + + + +#### B) Error on `generate_report` considering a project + +When running `generate_report("path/to/your/data/myData.dat")`, you might see this error in your R console: + + > generate_report("path/to/your/data/myData.dat") + [1] "Loading project..." + [1] "Loading data, performing checks, and saving output..." + [1] "ag_demand_clean" + Error in rgcam::getQuery(prj, "demand balances by crop commodity") : + getQuery: Query demand balances by crop commodity is not in any scenarios in the data set. + +This problem is due to a wrong path specification. + +**Possible solution**: make sure that you specified correctly the path. In addition: + +- In case you are using the `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `C:\Users\username\Documents\path\to\your\data\myData.dat` if you are using a Windows distribution. + +- In case you are using the `gcamreport` package following the [Docker installation](#with-docker): + + a) make sure that your data is inside the `gcamreport` folder. + + b) make sure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) + + c) make sure that you are pointing correctly to your data. For example, if in the `gcamreport` folder you have a folder called `amazingData` with your dataset `myData.dat`, you should refer to it as + +``` r +# option 1: full path +generate_report("/app/amazingData/myData.dat") + +# option 2: partial path +generate_report("amazingData/myData.dat") +``` +newline + + + + + + +#### C) Error related to *system* when using the Docker installation. + +Once the R console is opened, you might see this message after introducing any command: + + System has not been booted with systemd as init system (PID 1). Can't operate. + Failed to connect to bus: Host is down + Warning message: + In system("timedatectl", intern = TRUE) : + running command 'timedatectl' had status 1 + +**Possible solution**: simply type `Ctrl+C` and run your command again. diff --git a/vignettes/Interactive_UI_Tutorial.Rmd b/vignettes/Interactive_UI_Tutorial.Rmd index bd4f1790..697074f4 100644 --- a/vignettes/Interactive_UI_Tutorial.Rmd +++ b/vignettes/Interactive_UI_Tutorial.Rmd @@ -39,14 +39,16 @@ After generating an `.RData` dataset with the `generate_report()` function, simp ``` r # lanuch the user interface specifying the dataset variable name -launch_gcamreport_ui(data = report) # report is the name of the standardized - # dataset generated by generate_report() - # function. So, if you see it loaded in - # your environment, you can easily use - # it here!! :) +launch_gcamreport_ui(data = report, # report is the name of the + GCAM_version = 'v7.1') # standardized dataset generated + # by generate_report() function. + # So, if you see it loaded in your + # environment, you can easily use + # it here!! :) # lanuch the user interface specifying the dataset path -launch_gcamreport_ui(data_path = "/path/to/your/database/..._standardize.RData") +launch_gcamreport_ui(data_path = "/path/to/your/database/..._standardize.RData", + GCAM_version = 'v7.1') ``` newline @@ -60,7 +62,7 @@ launch_gcamreport_ui(data_path = "/path/to/your/database/..._standardize.RData") #### A) Large error when launching the UI -When running `launch_gcamreport_ui(data_path = "path/to/your/data.RData")`, you might get this message: +When running `launch_gcamreport_ui(data_path = "path/to/your/data.RData", GCAM_version = 'v7.1')`, you might get this message: launch_gcamreport_ui(data_path = "examples/example3.RData") diff --git a/vignettes/Interactive_UI_Tutorial_v7-0.Rmd b/vignettes/Interactive_UI_Tutorial_v7-0.Rmd new file mode 100644 index 00000000..fef66af8 --- /dev/null +++ b/vignettes/Interactive_UI_Tutorial_v7-0.Rmd @@ -0,0 +1,177 @@ +--- +title: "Interactive UI Tutorial for gcamreport v7.0*" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Interactive_UI_Tutorial_v7-0} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- +**ATTENTION**: this tutorial is compatible with `gcamreport v7.0*`, i.e, with `gcamreport v7.0.0` and `gcamreport v7.0.1` releases. For other releases, please check in the *Tutorials* drop-down menu in the main bar. + +newline + + + + + + + + + + + +## Example 1: launch UI when generating the dataset + +When running the main function `generate_report` (see [Dataset Generation Tutorial](https://bc3lc.github.io/gcamreport//articles//Dataset_Generation_Tutorial.html) for more information), simply set `launch_ui` to `TRUE` or do not specify anything since this is the default option. + +``` r +generate_report(..., launch_ui = TRUE) # this is the default option +``` +newline + + + + + + + +## Example 2: launch UI once the dataset has been generated + +After generating an `.RData` dataset with the `generate_report()` function, simply run `launch_gcamreport_ui` in R specifying either the dataset variable or the path to the `.RData` dataset. It should be something like `/path/to/your/database/..._standardize.RData` or `/path/to/your/project_file/..._standardize.RData`. + +``` r +# lanuch the user interface specifying the dataset variable name +launch_gcamreport_ui(data = report) # report is the name of the standardized + # dataset generated by generate_report() + # function. So, if you see it loaded in + # your environment, you can easily use + # it here!! :) + +# lanuch the user interface specifying the dataset path +launch_gcamreport_ui(data_path = "/path/to/your/database/..._standardize.RData") +``` +newline + + + + + + + +## Troubleshooting when launching the UI + +#### A) Large error when launching the UI + +When running `launch_gcamreport_ui(data_path = "path/to/your/data.RData")`, you might get this message: + + + launch_gcamreport_ui(data_path = "examples/example3.RData") + + Listening on http://127.0.0.1:7278 + + Attaching package: ‘magrittr’ + + The following objects are masked from ‘package:testthat’: + + equals, is_less_than, not + Attaching package: ‘shinydashboard’ + + The following object is masked from ‘package:graphics’: + + box + Learn different usages for shinyjs and other Shiny tricks: + https://deanattali.com/blog/advanced-shiny-tips + + Attaching package: ‘shinyjs’ + + The following object is masked from ‘package:shinyWidgets’: + + alert + The following object is masked from ‘package:shiny’: + + runExample + The following objects are masked from ‘package:methods’: + + removeClass, show + Warning in file(con, "r") : + cannot open file '/home/user/R/www/style.css': No such file or directory + Warning: Error in file: cannot open the connection + 72: file + 71: readLines + 70: includeCSS + 2: runApp + 1: launch_gcamreport_ui [/home/user/gcamreport/R/main.R#724] + +**Possible solution 1**: make sure that you cloned the repo. Check the instructions [here](https://bc3lc.github.io/gcamreport/index.html#installation-guide). + +**Possible solution 2**: make sure that you are using the `gcamreport` Rproject and that the R session working directory points the `gcamreport` cloned folder. In addition: + +- In case you are using the `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `data_path = C:\Users\username\Documents\path\to\your\gcamfolder\examples\example3.RData` if you are using a Windows distribution. + +- In case you are using the `gcamreport` package following the [Docker installation](#with-docker): + + a) make sure that your dataset is inside the `gcamreport` folder. + + b) make sure that you typed correctly the path to your `gcamreport` folder when generating the docker image (5th step in the [Docker section](#with-docker)) + + c) make sure that you are pointing correctly to your dataset. For example, if in the `gcamreport` folder you have a folder called `examples` with your dataset `amazingDataset.RData`, you should refer to it as + +``` r +# option 1: full path +generate_report(data_path = "/app/examples/amazingDataset.RData") + +# option 2: partial path +generate_report(data_path = "examples/amazingDataset.RData") +``` +newline + + + +#### B) Short error when launching the UI + +When launching the UI either through R, Rstudio or Docker, you might get this message: + + + Error in `shinyAppDir()`: + ! No Shiny application exists at the path "inst/gcamreport_ui" + + +**Possible solution 1**: make sure that you are using the `gcamreport` package through Rstudio (following the full R installation) or Docker. Otherwise the UI can not be launched. Check the installation instructions [here](https://bc3lc.github.io/gcamreport/index.html#installation-guide). + +**Possible solution 2**: make sure that you have a folder called `inst/gcamreport_ui` in your working session. It might be that your working directory has changed. To check it, run `getwd()` on your R console. If necessary, set again the working environment with `setwd()`. + + + +#### C) Wired message when launching the UI using the Docker installation. + +After using the functions `generate_report()` or `launch_gcamreport_ui()` to launch the UI, you might get this message: + + Listening on http://0.0.0.0:3838 + /usr/bin/xdg-open: 882: www-browser: not found + /usr/bin/xdg-open: 882: links2: not found + /usr/bin/xdg-open: 882: elinks: not found + /usr/bin/xdg-open: 882: links: not found + /usr/bin/xdg-open: 882: lynx: not found + /usr/bin/xdg-open: 882: w3m: not found + xdg-open: no method available for opening 'http://127.0.0.1:3838' + + + +This is not an error! You simply need to either go to your Docker Desktop program and click the last started port + +UI error + +or open this url in your favourite browser. + + + + +#### D) Error when using the UI through Docker installation. + +When opening your *localhost*, you might see this error: + +UI error + + + +**Possible solution**: your UI is not running. Try to either use the `generate_report()` function or the `launch_gcamreport_ui()`. diff --git a/vignettes/Modify_Mapping_Template_Tutorial.Rmd b/vignettes/Modify_Mapping_Template_Tutorial.Rmd index 7d0ca435..8864a31f 100644 --- a/vignettes/Modify_Mapping_Template_Tutorial.Rmd +++ b/vignettes/Modify_Mapping_Template_Tutorial.Rmd @@ -7,7 +7,7 @@ vignette: > %\VignetteEncoding{UTF-8} --- -In this tutorial, we will modify some of the pre-build mappings of the `gcamreport` package. It is necessary to have the `gcamreport` package installed either through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or [Docker](https://bc3lc.github.io/gcamreport/index.html#with-docker) +In this tutorial, we will modify some of the pre-build mappings of the `gcamreport` package. It is necessary to have the `gcamreport` package installed either through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or [Docker](https://bc3lc.github.io/gcamreport/index.html#with-docker). newline @@ -19,34 +19,207 @@ In this tutorial, we will modify some of the pre-build mappings of the `gcamrepo -## Example 1: step-by-step to add a new mapping item - *AvocadoSeeds* and *AvocadoSeedsTrees* +## Example 1: step-by-step to adapt current mappings to your GCAM version -In this example, we assume that the GCAM version has a more detailed land-food system and reports a new food item called *AvocadoSeeds* and a new land-leaf called *AvocadoSeedsTrees*. Thus, we need to modify `gcamreport` to include these items in the reporting dataset. In this example, the new items add to the final *cropland* area and several pollutant *emissions*, but do not have their own category in the template. +In this example, we assume that the GCAM version is a modified version of GCAM core 7.0, with additional or altered agricultural items. The goal is to run the `generate_report` function and adjust the mapping files as directed by the messages displayed in the console by the `gcamreport` package. + + + +1) Follow either the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). + +2) Open the `gcamreport.Rproj`. + +3) Run the `generate_report` function pointing to your database and indicating the most similar GCAM-core version: + +```r +generate_report(db_path = '../path/to/your/db', db_name = 'name_of_the_db', + prj_name = 'name_of_the_project.dat', scenarios = c('scenarios','list'), + final_year = XXX, GCAM_version = 'v7.0') +``` + +The project file will be generated, which may take some time. Once completed, the reporting standardization will begin. The first error you encounter may look something like this: + +```r +Loading data, performing checks, and saving output... +[1] "ag_demand_clean" + +Error in left_join_strict(., filter_variables(get(paste("ag_demand_map", : + Error: Some rows in the left dataset do not have matching keys in the right dataset. +``` + +This error indicates that the mapping file `ag_demand_map` does not contain all the required items when computing the `ag_demand_clean` variable. To resolve this, follow these steps: + +   3.1) Locate the variable generation code: + +     a) Open the file `R/functions.R` in the `gcamreport` folder. + +     b) Search (`Ctrl + F`) for the variable `ag_demand_clean`, which is generated within the `get_ag_demand()` function. + +   3.2) Identify the missing items: + +     a) Navigate to the section of the code that uses the `left_join_strict()` function: + + ```r + dplyr::bind_rows( + rgcam::getQuery(prj, "demand balances by crop commodity"), + rgcam::getQuery(prj, "demand balances by meat and dairy commodity") + ) %>% + # Adjust OtherMeat_Fish + dplyr::mutate(sector = dplyr::if_else(sector == "FoodDemand_NonStaples" & input == "OtherMeat_Fish", "OtherMeat_Fish", sector)) %>% + left_join_strict(filter_variables(get(paste('ag_demand_map',GCAM_version,sep='_'), envir = asNamespace("gcamreport")), "ag_demand_clean"), + by = c("sector"), multiple = "all") + ... + ``` + +     b) Add a break point at the beginning of the section and re-run the `generate_report` function again, this time pointing to your project file instead of the database to avoid regenerating the project and to stop at the breaking point: + +```r +generate_report(prj_name = '../path/to/your/dbname_of_the_project.dat', + scenarios = c('scenarios','list'), + final_year = XXX, GCAM_version = 'v7.0') +``` + +     c) To find the missing items, assign the lines before the `left_join_strict` function to a variable and the mapping items to another variable. Then, compare the two by `sector` as intended by the `left_join_strict` function. Use the following example: + + ```r + GCAM_version <- "v7.0" + + left_df <- dplyr::bind_rows( + rgcam::getQuery(prj, "demand balances by crop commodity"), + rgcam::getQuery(prj, "demand balances by meat and dairy commodity") + ) %>% + # Adjust OtherMeat_Fish + dplyr::mutate(sector = dplyr::if_else(sector == "FoodDemand_NonStaples" & input == "OtherMeat_Fish", "OtherMeat_Fish", sector)) + + right_df <- filter_variables(get(paste('ag_demand_map',GCAM_version,sep='_'), envir = asNamespace("gcamreport")), "ag_demand_clean") + + result <- dplyr::left_join(left_df, right_df, by = c("sector"), multiple = "all") + + unmatched <- result %>% + dplyr::filter(if_any(-one_of(names(left_df)), is.na)) + + View(unmatched) + ``` + +   3.3) Update the pre-build mappings: + +     a) Add the missing items to the `ag_demand_map` mapping file. Note that mapping files can sometimes be saved under different names. To find the correct file, open `inst/extdata/saveDataFiles_GCAM7.0.R` and search (`Ctrl + F`) for `ag_demand_map`: + + ```r + ag_demand_map_v7.0 <- read.csv(file.path(rawDataFolder, "inst/extdata/mappings/GCAM7.0", "ag_demand_map.csv"), + skip = 1, stringsAsFactors = FALSE) %>% gather_map() + + ``` + + In this example, the mapping file is located at `inst/extdata/mappings/GCAM7.0/ag_demand_map.csv`. Open the file, add the missing items, and save the changes. + + + **Note**: If you don't want to include certain items in the report, you can add a line with the new item indicating `NoReported` as variable: + + ```r + newItemName,NoReported,,,,,,,,1 + ``` + + **Note**: If the error persists and you prefer not to update the mapping file further, you can modify the `left_join_strict` call in the code to `dplyr::left_join.` However, **please be aware that this approach is not recommended, as it may compromise the strict matching intended in the data processing**. If you choose this option, please follow the next Step 3.4, source the `R/functions.R` file, and use Step 3.5 to ensure the new chuck will be read. + + + +   3.4) Stop the debugging process. + + +   3.5) Update the package data: + +     a) Run the `inst/extdata/saveDataFiles_GCAM7.0.R` script to update the package data. + +     b) Rebuild the package documentation using `Ctrl + Shift + D` or navigate to `Build > More > Document`. + +     c) Install the updated package by going to `Build > Install`. + +4) Run the `generate_report` function again, this time pointing to your project file instead of the database to avoid regenerating the project: + +```r +generate_report(prj_name = '../path/to/your/dbname_of_the_project.dat', + scenarios = c('scenarios','list'), + final_year = XXX, GCAM_version = 'v7.0') +``` + +The reporting procedure will start immediately and if the `ag_demand_map` mapping was arranged correctly, a new error will prompt regarding the `ag_prices_map`: + +```r +Loading data, performing checks, and saving output... +[1] "ag_demand_clean" +[1] "ag_prices_clean" + +Error in left_join_strict(., filter_variables(get(paste("ag_prices_map", : + Error: Some rows in the left dataset do not have matching keys in the right dataset. +``` + +Repeat the procedure outlined in Step 3 to correct the `ag_prices_map` file. + +5) Iterate Step 4 until the standardization process is complete. Occasionally, it may be necessary to clear all environment variables and restart R to ensure the updated mapping files are properly loaded. + + +6) Do not forget to push the changes to your branch and tag the new version to allow reproducibility and reusability!! :) + +**Note**: If you want to install this `gcamreport` version into other devices, indicate the tag or branch name when cloning the repository, for instance: + +``` bash +# to clone the tagged version "vUpdated": +git clone --branch vUpdated --single-branch https://github.com/bc3LC/gcamreport.git + +# to clone the branch version "vUpdated": +git clone --branch vUpdated https://github.com/bc3LC/gcamreport.git +``` + +or when installing through Rstudio, for instance: +``` r +# to install the tagged version "vUpdated" +devtools::install_github('bc3LC/gcamreport@vUpdated') + +# to install the branch version "vUpdated" +devtools::install_github('bc3LC/gcamreport@vUpdated') +``` + + + + +newline + + + + + + + + +## Example 2: step-by-step to add a new mapping item - *AvocadoSeeds* and *AvocadoSeedsTrees* + +In this example, we assume that the GCAM version is a modification of the GCAM core 7.0 version with a more detailed land-food system which reports a new food item called *AvocadoSeeds* and a new land-leaf called *AvocadoSeedsTrees*. Thus, we need to modify `gcamreport` to include these items in the reporting dataset. In this example, the new items add to the final *cropland* area and several pollutant *emissions*, but do not have their own category in the template. 1) Follow either the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker) 2) Open the `gcamreport.Rproj`. -3) To modify the mappings, it is best to relay on some similar item that is already present in the mappings. In this case, we relay on *NutsSeeds* and *NutsSeedsTree*. To see where the mapping modifications should be performed, search across all files (`Ctrl + Shift + F`) inside `inst/extdata/mappings` for the key words *NutsSeeds* and *NutsSeedsTree*. - +3) To modify the mappings, it is best to relay on some similar item that is already present in the mappings. In this case, we relay on *NutsSeeds* and *NutsSeedsTree*. To see where the mapping modifications should be performed, search across all files (`Ctrl + Shift + F`) inside `inst/extdata/mappings/GCAM7.0` for the key words *NutsSeeds* and *NutsSeedsTree*. + 4) Using the previous point method, we can see that we should add some lines to the following files stored in `inst/extdata/mappings`: - - a. `ag_prices_map.csv`. Add this line: + + a) `ag_prices_map.csv`. Add this line: ``` AvocadoTrees,,,,,,,,,1 ``` - b. `Kyotogas_sector.csv`. Add these lines: + b) `Kyotogas_sector.csv`. Add these lines: ``` CH4,AWB,AvocadoTrees,Emissions|Kyoto Gases,Emissions|Kyoto Gases|AFOLU,,,,,,,,,1 N2O,AGR,AvocadoTrees,Emissions|Kyoto Gases,Emissions|Kyoto Gases|AFOLU,,,,,,,,,1 N2O,AWB,AvocadoTrees,Emissions|Kyoto Gases,Emissions|Kyoto Gases|AFOLU,,,,,,,,,1 ``` - c. `land_use_map.csv`. Add these line + c) `land_use_map.csv`. Add these line ``` AvocadoTrees,Land Cover,Land Cover|Cropland,,,,,,,0.1 AvocadoTreesTree,Land Cover,Land Cover|Cropland,,,,,,,0.1 ``` - d. `nonCO2_emissions_sector_map.csv`. Add these lines + d) `nonCO2_emissions_sector_map.csv`. Add these lines ``` AvocadoTrees,BC_AWB,Emissions|BC,Emissions|BC|AFOLU,,,,,,,1 AvocadoTrees,CH4_AWB,Emissions|CH4,Emissions|CH4|AFOLU,,,,,,,1 @@ -64,7 +237,7 @@ In this example, we assume that the GCAM version has a more detailed land-food s AvocadoTrees,SO2_3_AWB,Emissions|Sulfur,Emissions|Sulfur|AFOLU,,,,,,,1 AvocadoTrees,SO2_4_AWB,Emissions|Sulfur,Emissions|Sulfur|AFOLU,,,,,,,1 ``` -5) Modify the query file (if necessary, as is in this example). To do it, copy the default query file located at `inst/extdata/queries/queries_gcamreport_gcam7.0_general.xml` and add these lines in the *aggregated land allocation* query. +5) Modify the query file (if necessary, as is in this example). To do it, copy the default query file located at `inst/extdata/queries/GCAM7.0/queries_gcamreport_general.xml` and add these lines in the *aggregated land allocation* query. ``` @@ -74,36 +247,37 @@ To use it when standardizing your GCAM output, run the `generate_report` functio generate_report(..., queries_general_file = "path/to/your/new_queries_general_file.xml") ``` -Another way to modify the query file is to update the default query file directly. To do this, open the default query file located at `inst/extdata/queries/queries_gcamreport_gcam7.0_general.xml` and add the necessary lines. The next step (step 6) will embed the new version of the query file into the package. With this method, it is no longer necessary to specify the query file path, as it will be your default general query file. +Another way to modify the query file is to update the default query file directly. To do this, open the default query file located at `inst/extdata/queries/GCAM7.0/queries_gcamreport_general.xml` and add the necessary lines. The next step (Step 6) will embed the new version of the query file into the package. With this method, it is no longer necessary to specify the query file path, as it will be your default general query file. -6) Update the pre-build mappings: - - a) Run the file `inst/extdata/saveDataFiles.R`. +6) Update the package data: - b) Build the document file: press `Ctrl + Shift + D` or click to `Build > More > Document`. + a) Run the `inst/extdata/saveDataFiles_GCAM7.0.R` script to update the package data. + + b) Rebuild the package documentation using `Ctrl + Shift + D` or navigate to `Build > More > Document`. + + c) Install the updated package by going to `Build > Install`. - c) Install the modified package: `Build > Install`. 7) Do not forget to push the changes to your branch and tag the new version to allow reproducibility and reusability!! :) **Note**: If you want to install this `gcamreport` version into other devices, indicate the tag or branch name when cloning the repository, for instance: ``` bash -# to clone the tagged version "v6.0.1": -git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git +# to clone the tagged version "vAvocado": +git clone --branch vAvocado --single-branch https://github.com/bc3LC/gcamreport.git -# to clone the branch version "gcam-v6.0": -git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git +# to clone the branch version "vAvocado": +git clone --branch vAvocado https://github.com/bc3LC/gcamreport.git ``` or when installing through Rstudio, for instance: ``` r -# to install the tagged version "v6.0.1" -devtools::install_github('bc3LC/gcamreport@v6.0.1') +# to install the tagged version "vAvocado" +devtools::install_github('bc3LC/gcamreport@vAvocado') -# to install the branch version "gcam-v6.0" -devtools::install_github('bc3LC/gcamreport@gcam-v6.0') +# to install the branch version "vAvocado" +devtools::install_github('bc3LC/gcamreport@vAvocado') ``` @@ -119,48 +293,48 @@ devtools::install_github('bc3LC/gcamreport@gcam-v6.0') -## Example 2: step-by-step to add/modify a template item - *Energy Service|Transportation|Freight|Bicycling and Walking* +## Example 3: step-by-step to add/modify a template item - *Energy Service|Transportation|Freight|Bicycling and Walking* -In this example, we assume that the GCAM version has a more detailed energy transportation freight service that considers *Bicycling and Walking*. We want to include this in the report as a new item: *Energy Service|Transportation|Passenger|Bicycling and Walking*. To do it, we need to modify the reporting template. +In this example, we assume that the GCAM version is a modification of the GCAM core 7.0 version a more detailed energy transportation freight service that considers *Bicycling and Walking*. We want to include this in the report as a new item: *Energy Service|Transportation|Passenger|Bicycling and Walking*. To do it, we need to modify the reporting template. 1) Follow either the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker) 2) Open the `gcamreport.Rproj`. 3) To modify the reporting template, it is best to relay on some similar item that is already present in the mappings. In this case, we relay on *Energy Service|Transportation|Freight|Road*. To see where the reporting template modifications should be performed, open the reporting template file (`inst/extdata/template/reporting_template.csv`) and search (`Ctrl + F`) for the key words *Energy Service|Transportation|Freight|Road*. - + 4) Using the previous point method, we can see that we should add one line to the reporting template: ``` "GCAM 7.0","Energy Service|Transportation|Freight|Bicycling and Walking","billion pkm/yr","energy_service_transportation_clean" ``` It contains the following columns: GCAM version, item name, units, and internal variable storing its value. -5) Update the pre-build reporting template: - - a) Run the file `inst/extdata/saveDataFiles.R`. +5) Update the package data reporting template: - b) Build the document file: press `Ctrl + Shift + D` or click to `Build > More > Document`. + a) Run the `inst/extdata/saveDataFiles_GCAM7.0.R` script to update the package data. - c) Install the modified package: `Build > Install`. + b) Rebuild the package documentation using `Ctrl + Shift + D` or navigate to `Build > More > Document`. + + c) Install the updated package by going to `Build > Install`. 6) Do not forget to push the changes to your branch and tag the new version to allow reproducibility and reusability!! :) **Note**: If you want to install this `gcamreport` version into other devices, indicate the tag or branch name when cloning the repository, for instance: ``` bash -# to clone the tagged version "v6.0.1": -git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git +# to clone the tagged version "vTransport": +git clone --branch vTransport --single-branch https://github.com/bc3LC/gcamreport.git -# to clone the branch version "gcam-v6.0": -git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git +# to clone the branch version "vTransport": +git clone --branch vTransport https://github.com/bc3LC/gcamreport.git ``` or when installing through Rstudio, for instance: ``` r -# to install the tagged version "v6.0.1" -devtools::install_github('bc3LC/gcamreport@v6.0.1') +# to install the tagged version "vTransport" +devtools::install_github('bc3LC/gcamreport@vTransport') -# to install the branch version "gcam-v6.0" -devtools::install_github('bc3LC/gcamreport@gcam-v6.0') +# to install the branch version "vTransport" +devtools::install_github('bc3LC/gcamreport@vTransport') ``` diff --git a/vignettes/README_v7-0.Rmd b/vignettes/README_v7-0.Rmd new file mode 100644 index 00000000..b455dfa0 --- /dev/null +++ b/vignettes/README_v7-0.Rmd @@ -0,0 +1,342 @@ +# gcamreport + +[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) + [![docs](https://github.com/bc3LC/gcamreport/actions/workflows/docs.yaml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/actions/workflows/docs.yaml) [![pages-build-deployment](https://github.com/bc3LC/gcamreport/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/bc3LC/gcamreport/actions/workflows/pages/pages-build-deployment) [![test_coverage](https://github.com/bc3LC/gcamreport/actions/workflows/test_coverage.yml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/actions/workflows/test_coverage.yml) [![codecov](https://codecov.io/gh/bc3LC/gcamreport/branch/gcam-v7.0/graph/badge.svg?token=GHV4F7TGFG)](https://codecov.io/gh/bc3LC/gcamreport) [![docker](https://github.com/bc3LC/gcamreport/actions/workflows/docker_impl.yaml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/actions/workflows/docker_impl.yaml) [![build](https://github.com/bc3LC/gcamreport/actions/workflows/build.yaml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/actions/workflows/build.yaml) + [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10960370.svg)](https://doi.org/10.5281/zenodo.10960370) + [![paper](https://github.com/bc3LC/gcamreport/actions/workflows/draft-pdf.yml/badge.svg?branch=gcam-v7.0)](https://github.com/bc3LC/gcamreport/blob/gcam-v7.0/paper/paper.pdf) + [![status](https://joss.theoj.org/papers/816fd8765945cd5f6fe6d8d1fefdde19/status.svg)](https://joss.theoj.org/papers/816fd8765945cd5f6fe6d8d1fefdde19) + + + + + + ## Contents + + + + + + - [Contents](#contents) + + - [Introduction](#introduction) + + - [Installation Guide](#installation-guide) + + - [With R](#with-r) + + - [Light mode installation](#with-R-light-mode-installation) + + - [Full mode installation](#with-R-full-mode-installation) + + - [With Docker](#with-docker) + + - [Getting Started](#get-started) + + - [Warnings and Error Messages](#bugs) + + + + + + ## Introduction + + + + + + [Back to Contents](#contents) + + `gcamreport` is a tool that generates a consistent dataset from any scenario run by the Global Change Analysis Model ([GCAM](http://www.globalchange.umd.edu/gcam/)) that meets the reporting requirements of the Integrated Assessment Modeling Consortium ([IAMC](https://www.iamconsortium.org/)). In addition, `gcamreport` includes an interactive user widget that allows users to generate and download plots live, as well as download reduced versions of the formatted dataset in spreadsheet format. + + + + + + ## Installation Guide + + + + + + [Back to Contents](#contents) + + There are multiple equivalent ways to install this package: + + ### With R + + There are two ways to install the `gcamreport` package through R. The [light mode installation](#with-R-light-mode-installation) requires only R as it installs the `gcamreport` package directly from the GitHub repository. It is suitable for general use of the package but not compatible with the user interface. The [full mode installation](#with-R-full-mode-installation) requires R, Rstudio and cloning the GitHub repository. It is suitable for general use of the package and allows you to launch the user interface. It is also the best option if you are actively developing or modifying the `gcamreport` package, as it allows you to modify the mappings and functions to create suitable versions for your GCAM model. + + #### Light mode installation + + 1. Requirements + + - R (to download, click [here](https://www.r-project.org/)) + + + + + + 2. Open R and install the `gcamreport` package: + + ``` r + install.packages('devtools') + devtools::install_github('bc3LC/gcamreport') + ``` + + Now `gcamreport` package is fully loaded. Enjoy! :smile: + + **Note**:boom:: If you want to install specific `gcamreport` versions, indicate the tag or branch name when running the installation command. For instance: + + ``` r + # to install the tagged version "v6.0.1" + devtools::install_github('bc3LC/gcamreport@v6.0.1') + + # to install the branch version "gcam-v6.0" + devtools::install_github('bc3LC/gcamreport@gcam-v6.0') + ``` + +
+ + #### Full mode installation + + 1. Requirements + + - R (to download, click [here](https://www.r-project.org/)) + + - Rstudio (to download, click [here](https://www.rstudio.com/)) + + - Git (to download, click [here](https://git-scm.com/downloads/)) + + 2. Open git bash in the folder where you want to clone the repository and clone it: + + ``` bash + git clone https://github.com/bc3LC/gcamreport.git + ``` + + 3. Load the `gcamreport` package: Open the `gcamreport` folder you just cloned and double-click the `gcamreport.Rproj` file. RStudio should open the project. Load the library: + + ``` r + install.packages('devtools') + devtools::load_all() + ``` + + Now `gcamreport` package is fully loaded. Enjoy! :smile: + + **Note**:boom:: If you want to install specific `gcamreport` versions, indicate the tag or branch name when cloning the repository. For instance: + + ``` bash + # to clone the tagged version "v6.0.1": + git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git + + # to clone the branch version "gcam-v6.0": + git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git + ``` + + +
+ + ### With Docker + + This installation method allows you not to worry about the R libraries and dependencies. Docker provides you with an already updated environment suitable for running the `gcamreport` package. + + 1. Requirements + + - Docker Desktop (to download, click [here](https://docs.docker.com/get-docker/)) + + - Git (to download, click [here](https://git-scm.com/downloads)) + + 2. Open git bash in the folder where you want to clone the repository and clone it: + + ``` bash + git clone https://github.com/bc3LC/gcamreport.git + ``` + + 3. Open Docker Desktop (double-click the icon on your computer) and leave it running in the background. + + 4. Inside a terminal (bash or cmd) pull the docker image: + + ``` bash + docker pull claudiarodes/gcamreport_docker:gcam-v7.0-v2 + ``` + + **Note**:exclamation:: This step requires 13.5GB of free space in your computer. + + 5. Run the Docker container using your full path to the `gcamreport` folder: + + ``` bash + docker run -v /path/to/gcamreport:/app -p 4000:3838 -it claudiarodes/gcamreport_docker:gcam-v7.0-v2 + ``` + + This should prompt an R console in your terminal. + + 6. Install the `gcamreport` package in the new R console: + + ``` r + remotes::install_github("bc3LC/gcamreport") #you can skip all updates in case you are asked + library(gcamreport) + ``` + + Now `gcamreport` package is fully loaded. Enjoy! :smile: + + + **Note**:exclamation:: To access local files, you should place them in the `gcamreport` folder, which is now considered the root of the R session. Inside the R session it is referred to as `/app`. + + **Note**:exclamation:: To reuse the docker image, you can simply perform steps 3, 5, and 6, since the docker image is already on your computer. + + **Note**:exclamation:: If you followed the [Docker installation](#with-Docker), to open the user interface (UI) once it has been launched, either go to the Docker Desktop and type the last port started, or type in your browser. + + UI error + + + **Note**:boom:: If you want to install previous `gcamreport` versions, indicate the tag or branch name when cloning the repository (step 2). For instance: + + ``` bash + # to clone the tagged version "v6.0.1": + git clone --branch v6.0.1 --single-branch https://github.com/bc3LC/gcamreport.git + + # to clone the branch version "gcam-v6.0": + git clone --branch gcam-v6.0 https://github.com/bc3LC/gcamreport.git + ``` + +
+ + + + + + ## Getting Started + + + + + + [Back to Contents](#contents) + + The `gcamreport` package consists of a set of functions divided into two different blocks: + + - Dataset generation: It creates or loads an existing project and automatically saves the generated dataset that meets the reporting requirements of the [IAMC](https://www.iamconsortium.org/). Main function: `generate_report()`. For more information, see this [tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html) or type `??generate_report` in your R console. If you get any warning or error messages, you might want to look at the [Warnings and Error Messages](#bugs) section. + + - Interactive user block: it launches an interactive widget that displays the dataset in tabular form, with the ability to filter, reorder and download live. It also displays plots and allows them to be downloaded, aggregated by variables, regions and scenarios. Main function: `launch_gcamreport_ui()`. For more information see this [tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html) or type `??launch_gcamreport_ui` in your R console. If you get any warning or error messages, it might be useful to have a look at the [Warnings and Error Messages](#bugs) section. + + + The package also includes some default input files (.Rda) that are read by the different functions. These can be changed by the user as detailed in [this tutorial](https://bc3lc.github.io/gcamreport/articles/Modify_Mapping_Template_Tutorial.html). + +
+ + + + + + ## Warnings and Error Messages + + + + + + [Back to Contents](#contents) + + Some typical and already-known errors that can be easily solved! :bulb: + + :computer: Error on "run("path/to/your/data/myData.dat")" + + In your R console, you might see this error: + + > generate_report("path/to/your/data/myData.dat") + [1] "Loading project..." + [1] "Loading data, performing checks, and saving output..." + [1] "ag_demand_clean" + Error in rgcam::getQuery(prj, "demand balances by crop commodity") : + getQuery: Query demand balances by crop commodity is not in any scenarios in the data set. + +
+ + **Possible solution** + + This problem is due to a wrong path specification. Thus, make sure that you specified correctly the path. In addition: + + - In case you are using `gcamreport` package following the [R installation](#with-r), try to copy the whole path to your data, for instance `C:\Users\username\Documents\path\to\your\data\myData.dat` if you are using a Windows distribution. + + - In case you are using `gcamreport` package following the [Docker installation](#with-docker): + + a) make sure that your data is inside the `gcamreport` folder. + + b) make sure that you type correctly the path to your `gcamreport` folder when running the docker image (5th step in the [Docker section](#with-docker)) + + c) make sure that you are pointing correctly to your data. For example, if in the `gcamreport` folder you have a folder called `amazingData` with your dataset `myData.dat`, you should refer to it as + + ``` r + # option 1: full path + generate_report("/app/amazingData/myData.dat") + + # option 2: partial path + generate_report("amazingData/myData.dat") + ``` + +
+ +
+ + :computer: Wired message when launching the UI when using the Docker installation. + + After using the functions `generate_report()` or `launch_gcamreport_ui()` to launch the UI, you might get this message: + + Listening on http://0.0.0.0:3838 + /usr/bin/xdg-open: 882: www-browser: not found + /usr/bin/xdg-open: 882: links2: not found + /usr/bin/xdg-open: 882: elinks: not found + /usr/bin/xdg-open: 882: links: not found + /usr/bin/xdg-open: 882: lynx: not found + /usr/bin/xdg-open: 882: w3m: not found + xdg-open: no method available for opening 'http://127.0.0.1:3838' + +
+ + **Possible solution** + + This is not an error! You simply need to either go to your Docker Desktop program and click the last started port + + UI error + + or open this url in your favourite browser. + +
+ +
+ + :computer: Error when using the UI through Docker installation. + + When oppening your *localhost*, you might see this error: + + UI error + +
+ + **Possible solution** + + Your UI is not running. Try to either use the `generate_report()` function or the `launch_gcamreport_ui()`. + +
+ +
+ + :computer: Error related to *system* when using the Docker installation. + + Once the R console is opened, you might see this message after introducing any command: + + System has not been booted with systemd as init system (PID 1). Can't operate. + Failed to connect to bus: Host is down + Warning message: + In system("timedatectl", intern = TRUE) : + running command 'timedatectl' had status 1 + +
+ +**Possible solution** + +Simply type `Ctrl+C` and run your command again. + +
+ +
+ +**Note**::boom: For other errors, please check the troubleshooting sections of the [`generate_report` function](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#troubleshooting-for-the-generate_report-function) or the [user interface widget](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html#troubleshooting-when-launching-the-ui). If your error is not listed, please open an [Issue](https://github.com/bc3LC/gcamreport/issues) on the GitHub page with all the information to reproduce the crash. diff --git a/vignettes/Step_By_Step_Full_Example.Rmd b/vignettes/Step_By_Step_Full_Example.Rmd index 578197c9..51be7540 100644 --- a/vignettes/Step_By_Step_Full_Example.Rmd +++ b/vignettes/Step_By_Step_Full_Example.Rmd @@ -7,7 +7,7 @@ vignette: > %\VignetteEncoding{UTF-8} --- -In this tutorial, we will 1) generate a dataset from a provided GCAM7.0 database and launch the associated user interface, 2) generate a dataset from a provided project and launch the corresponding user interface, and 3) launch the user interface from a provided standardized dataset. To know more about the `gcamreport` package possibilities, look at these tutorials: [dataset generation tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html) and [user interface tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html). +In this tutorial, we will 1) generate a dataset from a provided GCAM database and launch the associated user interface, 2) generate a dataset from a provided project and launch the corresponding user interface, and 3) launch the user interface from a provided standardized dataset. To know more about the `gcamreport` package possibilities, look at these tutorials: [dataset generation tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html) and [user interface tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html). newline @@ -23,7 +23,7 @@ In this tutorial, we will 1) generate a dataset from a provided GCAM7.0 database 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. -2) Download the example [GCAM7.0 database](https://zenodo.org/records/10258919), store it inside `gcamreport/examples`, and unpack it. Make sure that the database is directly located in `gcamreport/examples/database_basexdb_ref` and an intermediate folder has not appeared. +2) Download the example [GCAM7.1 database](https://zenodo.org/records/13361605), store it inside `gcamreport/examples`, and unpack it. Make sure that the database is directly located in `gcamreport/examples/database_basexdb_ref` and an intermediate folder has not appeared. 3) Load the `gcamreport` library. If you are using Rstudio or Docker, run @@ -44,15 +44,16 @@ library(gcamreport) dbpath <- "examples" dbname <- "database_basexdb_ref" scen <- "Reference" +GCAMv <- "v7.1" ## -- choose a project name -prjname <- "example1.dat" +prjname <- "example1_v7.1.dat" ## -- generate the reporting dataset until 2050 for EU-12 and EU-15 for all the ## -- Agricultural variables, save the output in .RData, .csv and .xlsx format, ## -- and lunch the user interface generate_report(db_path = dbpath, db_name = dbname, scenarios = scen, - prj_name = prjname, final_year = 2050, + prj_name = prjname, final_year = 2050, GCAM_version = GCAMv, desired_regions = c('EU-12', 'EU-15'), desired_variables = c('Agricultural*'), save_output = TRUE, launch_ui = TRUE) @@ -67,11 +68,14 @@ In case you experience some trouble, check this [troubleshooting section](https: **Note**: Remember that the user interface can only be launched through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). -6) Check the generated dataset: look in the `examples` folder and you should see two files named `example1_standardized.csv` and `example1_standardized.xlsx` containing the standardized dataset. +6) Check the generated dataset: look in the `examples` folder and you should see two files named `example1_v7.1_standardized.csv` and `example1_v7.1_standardized.xlsx` containing the standardized dataset. -7) Note that a file called `database_basexdb_ref_example1.dat` has appeared in the `examples` folder. This is the generated project file from the provided database. If you want to rebuild the standardized dataset or launch the user interface, you can use this file directly and avoid rebuilding the project. If you want to proceed as mentioned, you can follow [Example 2](#example2). +7) Note that a file called `database_basexdb_ref_example1_v7.1.dat` has appeared in the `examples` folder. This is the generated project file from the provided database. If you want to rebuild the standardized dataset or launch the user interface, you can use this file directly and avoid rebuilding the project. If you want to proceed as mentioned, you can follow [Example 2](#example2). -8) Note that a file named `example1_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). +8) Note that a file named `example1_v7.1_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). + + +**Note**: You can do this step-by-step example using the provided [GCAM7.0 database](https://zenodo.org/records/10258919), the default [GCAM6.0 database](https://zenodo.org/record/8162970), or your own database! Remember to indicate the `GCAM_version` when generating the report ;) newline @@ -87,7 +91,7 @@ In case you experience some trouble, check this [troubleshooting section](https: 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker -2) In this example we will use an example rgcam project stored in `examples` called `example2.dat` +2) In this example we will use an example rgcam project stored in `examples` called `example2_v7.1.dat` 3) Load the `gcamreport` library. If you are using Rstudio or Docker, run @@ -105,12 +109,13 @@ library(gcamreport) ```r ## -- store the project path and name in a variable. -prjname <- "examples/example2.dat" +prjname <- "examples/example2_v7.1.dat" ## -- generate the reporting dataset until 2050 for EU-12 and EU-15 for all the ## -- Agricultural variables, save the output in .RData, .csv and .xlsx format, ## -- and lunch the user interface generate_report(prj_name = prjname, final_year = 2050, + GCAM_version = 'v7.1', desired_regions = c('EU-12', 'EU-15'), desired_variables = c('Agricultural*'), save_output = TRUE, launch_ui = TRUE) @@ -123,9 +128,11 @@ In case you experience some trouble, check this [troubleshooting section](https: **Note**: Remember that the user interface can only be launched through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). -6) Check the generated dataset: look in the `examples` folder and you should see two files named `example2_standardized.csv` and `example2_standardized.xlsx` containing the standardized dataset. +6) Check the generated dataset: look in the `examples` folder and you should see two files named `example2_v7.1_standardized.csv` and `example2_standardized.xlsx` containing the standardized dataset. -7) Note that a file called `example2_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). +7) Note that a file called `example2_v7.1_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). + +**Note**: You can do this step-by-step example using the provided `example2_v7.0.dat` or `example2_v6.0.dat` projects, or the projects generated through your own database! Remember to indicate the `GCAM_version` when generating the report ;) newline @@ -143,7 +150,7 @@ In case you experience some trouble, check this [troubleshooting section](https: 1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with the R full installation or the Docker installation. -2) In this example we will use a standardized example dataset stored in `examples` called `example3.RData`. +2) In this example we will use a standardized example dataset stored in `examples` called `example3_v7.1.RData`. 3) Load the `gcamreport` library: @@ -159,10 +166,11 @@ devtools::load_all() # if using Rstudio or Docker library(gcamreport) # if using R ## -- store the project path and name in a variable. -datapath <- "examples/example3.RData" +datapath <- "examples/example3_v7.1.RData" +GCAMv <- "v7.1" ## -- launch the user interface -launch_gcamreport_ui(data_path = datapath) +launch_gcamreport_ui(data_path = datapath, GCAM_version = GCAMv) ``` In case you experience some trouble, check this [troubleshooting section](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html#troubleshooting-when-launching-the-ui-with-the-docker-installation). @@ -180,9 +188,10 @@ library(gcamreport) # if using R ## -- store the database path, name, and scenarios in a variable. dataname <- "report" +GCAMv <- "v7.1" ## -- launch the user interface -launch_gcamreport_ui(data = dataname) +launch_gcamreport_ui(data = dataname, GCAM_version = GCAMv) ``` - +**Note**: You can do this step-by-step example using the provided `example3_v7.0.RData` or `example3_v6.0.RData` files, or the files generated through your own database! Remember to indicate the `GCAM_version` when generating the report ;) diff --git a/vignettes/Step_By_Step_Full_Example_v7-0.Rmd b/vignettes/Step_By_Step_Full_Example_v7-0.Rmd new file mode 100644 index 00000000..5ecdc6b3 --- /dev/null +++ b/vignettes/Step_By_Step_Full_Example_v7-0.Rmd @@ -0,0 +1,201 @@ +--- +title: "Step By Step Full Example for gcamreport v7.0*" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Step_By_Step_Full_Example_v7-0} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +**ATTENTION**: this tutorial is compatible with `gcamreport v7.0*`, i.e, with `gcamreport v7.0.0` and `gcamreport v7.0.1` 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 GCAM7.0 database and launch the associated user interface, 2) generate a dataset from a provided project and launch the corresponding user interface, and 3) launch the user interface from a provided standardized dataset. To know more about the `gcamreport` package possibilities, look at these tutorials: [dataset generation tutorial](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html) and [user interface tutorial](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html). + +newline + + + + + + + + + +## Example 1: step-by-step standardized dataset generation from a provided database + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker. + +2) Download the example [GCAM7.0 database](https://zenodo.org/records/10258919), store it inside `gcamreport/examples`, and unpack it. Make sure that the database is directly located in `gcamreport/examples/database_basexdb_ref` and an intermediate folder has not appeared. + +3) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +4) Generate the standardized dataset: + +``` r +## -- 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 reporting dataset until 2050 for EU-12 and EU-15 for all the +## -- Agricultural variables, save the output in .RData, .csv and .xlsx format, +## -- and lunch the user interface +generate_report(db_path = dbpath, db_name = dbname, scenarios = scen, + prj_name = prjname, final_year = 2050, + desired_regions = c('EU-12', 'EU-15'), + desired_variables = c('Agricultural*'), + save_output = TRUE, launch_ui = TRUE) +``` + +In case you experience some trouble, check this [troubleshooting section](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#troubleshooting-for-the-generate_report-function). + + +5) Once the project has been generated and the standardized dataset created, the user interface will prompt. If you are using Rstudio, it will automatically open. For a better experience, click the `open in browser` button. If you are using Docker, either type in the browser or go to Docker Desktop and click the last started port. + +UI error + +**Note**: Remember that the user interface can only be launched through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). + +6) Check the generated dataset: look in the `examples` folder and you should see two files named `example1_standardized.csv` and `example1_standardized.xlsx` containing the standardized dataset. + +7) Note that a file called `database_basexdb_ref_example1.dat` has appeared in the `examples` folder. This is the generated project file from the provided database. If you want to rebuild the standardized dataset or launch the user interface, you can use this file directly and avoid rebuilding the project. If you want to proceed as mentioned, you can follow [Example 2](#example2). + +8) Note that a file named `example1_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). + +newline + + + + + + + + + +## Example 2: step-by-step standardized dataset generation from a provided project {#example2} + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with R or Docker + +2) In this example we will use an example rgcam project stored in `examples` called `example2.dat` + +3) Load the `gcamreport` library. If you are using Rstudio or Docker, run + +``` r +devtools::load_all() +``` + +and if you are using R, run + +``` r +library(gcamreport) +``` + +4) Generate the standardized dataset: + +```r +## -- store the project path and name in a variable. +prjname <- "examples/example2.dat" + +## -- generate the reporting dataset until 2050 for EU-12 and EU-15 for all the +## -- Agricultural variables, save the output in .RData, .csv and .xlsx format, +## -- and lunch the user interface +generate_report(prj_name = prjname, final_year = 2050, + desired_regions = c('EU-12', 'EU-15'), + desired_variables = c('Agricultural*'), + save_output = TRUE, launch_ui = TRUE) +``` +In case you experience some trouble, check this [troubleshooting section](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#troubleshooting-for-the-generate_report-function). + +5) Once the project has been generated and the standardized dataset created, the user interface will prompt. If you are using Rstudio, it will automatically open. For a better experience, click the `open in browser` button. If you are using Docker, either type in the browser or go to Docker Desktop and click the last started port. + +UI error + +**Note**: Remember that the user interface can only be launched through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). + +6) Check the generated dataset: look in the `examples` folder and you should see two files named `example2_standardized.csv` and `example2_standardized.xlsx` containing the standardized dataset. + +7) Note that a file called `example2_standardized.RData` has appeared in the `examples` folder. This is the report file generated from the provided database. If you want to launch the user interface in the future, you can use this file directly and avoid creating or loading the project again. If you want to proceed as mentioned, you can follow [Example 3](#example3). + +newline + + + + + + + + + +## Example 3: step-by-step user interface launching from a provided standardized dataset {#example3} + +**Note**: Remember that the user interface can only be launched through the [full R installation](https://bc3lc.github.io/gcamreport/index.html#with-r-full-mode-installation) or the [Docker installation](https://bc3lc.github.io/gcamreport/index.html#with-docker). + +1) Follow the [installation guide](https://bc3lc.github.io/gcamreport/index.html#installation-guide) either with the R full installation or the Docker installation. + +2) In this example we will use a standardized example dataset stored in `examples` called `example3.RData`. + +3) Load the `gcamreport` library: + +``` r +devtools::load_all() +``` + +4) Launch the user interface for the standardized dataset: + +``` r +## -- load gcamreport library. +devtools::load_all() # if using Rstudio or Docker +library(gcamreport) # if using R + +## -- store the project path and name in a variable. +datapath <- "examples/example3.RData" + +## -- launch the user interface +launch_gcamreport_ui(data_path = datapath) +``` +In case you experience some trouble, check this [troubleshooting section](https://bc3lc.github.io/gcamreport/articles/Interactive_UI_Tutorial.html#troubleshooting-when-launching-the-ui-with-the-docker-installation). + + +5) Once the project has been generated and the standardized dataset created, the user interface will prompt. If you are using Rstudio, it will automatically open. For a better experience, click the `open in browser` button. If you are using Docker, either type in the browser or go to Docker Desktop and click the last started port. + +UI error + +6) If you just ran [Example 1](#example1) or [Example 2](#example2), you should have a variable called `report` in the environment. You can also use it to launch the user interface: + +``` r +## -- load gcamreport library. +devtools::load_all() # if using Rstudio or Docker +library(gcamreport) # if using R + +## -- store the database path, name, and scenarios in a variable. +dataname <- "report" + +## -- launch the user interface +launch_gcamreport_ui(data = dataname) +``` + + diff --git a/vignettes/Version_Guide.Rmd b/vignettes/Version_Guide.Rmd index fd488df3..e0c304d4 100644 --- a/vignettes/Version_Guide.Rmd +++ b/vignettes/Version_Guide.Rmd @@ -7,16 +7,44 @@ vignette: > %\VignetteEncoding{UTF-8} --- -Each `gcamreport` release is linked either to a `GCAM` version or a study where GCAM was used. We follow a specific naming and tagging procedure for each release: they are all linked to a tag, whose name firstly contains two numbers indicating the compatible GCAM version (e.g. **v6.0** indicates that it is compatible with GCAM 6.0); the next number indicates the version release (e.g. v6.0.**0** indicates that it is the **first** release compatible with GCAM 6.0). This numeration starts from 0. Finally, if the release is linked to a project, the tag's name contains a hyphen and a key work (e.g. v6.0.0**-gas**). +The `gcamreport` package is compatible with the main versions of GCAM: [6.0](https://zenodo.org/records/6619287), [7.0](https://zenodo.org/records/8010145), and [7.1](https://zenodo.org/records/11481167). To use these versions, ensure that you have cloned the `gcam-core` branch (the default branch) and specify the closest GCAM version using the `GCAM_version` parameter in the [`generate_report`](https://bc3lc.github.io/gcamreport/reference/generate_report.html) or [`launch_gcamreport_ui`](https://bc3lc.github.io/gcamreport/reference/launch_gcamreport_ui.html) functions, as demonstrated in this [example](https://bc3lc.github.io/gcamreport/articles/Dataset_Generation_Tutorial.html#example-6-specify-the-GWP-or-GCAM-version). If you need to modify mappings to better suit your GCAM version, refer to this [tutorial](TODO) and remember to tag the version to ensure reproducibility of the results ;) -Find below a description of all the releases: +This approach allows users to access the full range of `gcamreport` functionalities regardless of the GCAM version they are using. Additionally, it streamlines the process of bug fixing and updating `gcamreport` to stay in line with GCAM-core updates. Future versions of `gcamreport` will be released under the following naming convention: `gcamreport a.b.c`, where *a.b.c* denotes the release version of `gcamreport` (e.g., *1.0.0*, *1.0.1*, *1.2.0*, ...). Major releases will increment the first digit (*a*), while minor updates will increment the second (*b*) or third (*c*) digit. -| `gcamreport` tag-version | `GCAM` version and/or study | +newline + +Previous `gcamreport` versions were linked either to a `GCAM` version or a study where GCAM was used. We followed a specific naming and tagging procedure for each release: they were all linked to a tag, whose name firstly contained two numbers indicating the compatible GCAM version (e.g. *v6.0* indicates that it is compatible with GCAM 6.0); the next number indicated the version release (e.g. v6.0.*0* indicates that it is the *first* release compatible with GCAM 6.0). This numeration started from 0. Finally, if the release was linked to a project, the tag's name contained a hyphen and a key work (e.g. v6.0.0*-gas*). Currently, this procedure is **depracated**, but the tags are still available if you want to reproduce some versions. + +To install previous `gcamreport` versions, indicate the tag or branch name when cloning the repository. For instance: + +``` bash +# to clone the tagged version "v6.0.1-depracated": +git clone --branch v6.0.1-depracated --single-branch https://github.com/bc3LC/gcamreport.git + +# to clone the branch version "gcam-v6.0-depracated": +git clone --branch gcam-v6.0-depracated https://github.com/bc3LC/gcamreport.git +``` +Or install the suitable version in your R session: + +``` R +# to install the tagged version "v6.0.1-depracated" +devtools::install_github('bc3LC/gcamreport@v6.0.1-depracated') + +# to install the branch version "gcam-v6.0-depracated" +devtools::install_github('bc3LC/gcamreport@gcam-v6.0-depracated') +``` + +newline + +Find below a description of all the `gcamreport` releases: + +| `gcamreport` tag-version | compatible `GCAM` version and/or study | |--------------------------|------------------------------------| -| v7.0.1 | GCAM 7.0 | -| v7.0.0 | GCAM 7.0 | -| v6.0.1 | GCAM 6.0 | -| v6.0.0 | GCAM 6.0 | -| v6.0.0-gas | GCAM 6.0 with gas extra features | +| v1.0.0 | GCAM 6.0, GCAM 7.0, and GCAM 7.1 | +| depracted_v7.0.1 | GCAM 7.0 | +| depracted_v7.0.0 | GCAM 7.0 | +| depracted_v6.0.1 | GCAM 6.0 | +| depracted_v6.0.0 | GCAM 6.0 | +| depracted_v6.0.0-gas | GCAM 6.0 with gas extra features | You can see the new feature of each release and download the corresponding versions [here](https://bc3lc.github.io/gcamreport/news/index.html). diff --git a/vignettes/gcamreport_v7-0.Rmd b/vignettes/gcamreport_v7-0.Rmd new file mode 100644 index 00000000..f0a46dcf --- /dev/null +++ b/vignettes/gcamreport_v7-0.Rmd @@ -0,0 +1,21 @@ +--- +title: "Tutorials for gcamreport v7.0*" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{gcamreport_v7-0} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +Find below all tutorials compatible with `gcamreport v7.0*` releases (i.e. `gcamreport v7.0.0` and `gcamreport v7.0.1`): + + +[README for gcamreport v7.0*](README_v7-0.html) + +[Step-by-step Full Example for gcamreport v7.0*](Step_By_Step_Full_Example_v7-0.html) + +[Dataset Generation Tutorial for gcamreport v7.0*](Dataset_Generation_Tutorial_v7-0.html) + +[Interactive UI Tutorial for gcamreport v7.0*](Interactive_UI_Tutorial_v7-0.html) + +**Note**: These versions and their documentation pages are no longer maintained.