Repository: pik-piam/remind2
Pull request #711: cs2: added plots on SE/FE level
Author: login: robertsalzwedel
Labels: name: enhancement
description: New feature or request
name: compare scenarios
Created: 2025-03-25T21:35:30Z | Merged: 2025-03-31T15:09:43Z

## Purpose of this PR

is to improve the cs2 with an additional plot on the SE level and two on the FE level. The PR includes: 
1. one bar plot for the SE totals with carrier resolution
2. one bar plot for the FE totals, with carrier resolution
3. one bar plot for the FE totals, with carrier and sector resolution 

Colors where added in [this PR ](https://github.com/pik-piam/mip/pull/129). 



Diff:
diff --git a/.buildlibrary b/.buildlibrary
index 0ead91f4..6789e279 100644
--- a/.buildlibrary
+++ b/.buildlibrary
@@ -1,4 +1,4 @@
-ValidationKey: '236491350'
+ValidationKey: '236687940'
 AcceptedWarnings:
 - .*following variables are expected in the piamInterfaces.*
 - Summation checks have revealed some gaps.*
diff --git a/CITATION.cff b/CITATION.cff
index c5381fe5..fccdf065 100755
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -2,8 +2,8 @@ cff-version: 1.2.0
 message: If you use this software, please cite it using the metadata from this file.
 type: software
 title: 'remind2: The REMIND R package (2nd generation)'
-version: 1.172.2
-date-released: '2025-03-28'
+version: 1.173.0
+date-released: '2025-03-31'
 abstract: Contains the REMIND-specific routines for data and model output manipulation.
 authors:
 - family-names: Rodrigues
diff --git a/DESCRIPTION b/DESCRIPTION
index 63e5a1a9..d1fbedf6 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
 Type: Package
 Package: remind2
 Title: The REMIND R package (2nd generation)
-Version: 1.172.2
-Date: 2025-03-28
+Version: 1.173.0
+Date: 2025-03-31
 Authors@R: c(
     person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")),
     person("Lavinia", "Baumstark", role = "aut"),
diff --git a/README.md b/README.md
index dc916013..3dd2585c 100755
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # The REMIND R package (2nd generation)
 
-R package **remind2**, version **1.172.2**
+R package **remind2**, version **1.173.0**
 
 [![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/builds)
 
@@ -49,7 +49,7 @@ In case of questions / problems please contact Renato Rodrigues <renato.rodrigue
 
 To cite package **remind2** in publications use:
 
-Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Dorndorf T, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P, Rüter T (2025). "remind2: The REMIND R package (2nd generation)." Version: 1.172.2, <https://github.com/pik-piam/remind2>.
+Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Dorndorf T, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P, Rüter T (2025). "remind2: The REMIND R package (2nd generation)." Version: 1.173.0, <https://github.com/pik-piam/remind2>.
 
 A BibTeX entry for LaTeX users is
 
@@ -57,9 +57,9 @@ A BibTeX entry for LaTeX users is
 @Misc{,
   title = {remind2: The REMIND R package (2nd generation)},
   author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Tabea Dorndorf and Jakob Duerrwaechter and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann and Tonn Rüter},
-  date = {2025-03-28},
+  date = {2025-03-31},
   year = {2025},
   url = {https://github.com/pik-piam/remind2},
-  note = {Version: 1.172.2},
+  note = {Version: 1.173.0},
 }
 ```
diff --git a/inst/compareScenarios/cs_04_energy_supply.Rmd b/inst/compareScenarios/cs_04_energy_supply.Rmd
index cf4f627a..f12d6984 100644
--- a/inst/compareScenarios/cs_04_energy_supply.Rmd
+++ b/inst/compareScenarios/cs_04_energy_supply.Rmd
@@ -326,6 +326,23 @@ showLinePlots(data, "PE|Geothermal")
 
 ## SE Mix
 
+### SE Totals 
+
+```{r SE Totals}
+
+tot <- "SE"
+
+items <- c(
+  "SE|Electricity",
+  "SE|Heat",
+  "SE|Hydrogen",
+  "SE|Gases",
+  "SE|Liquids",
+  "SE|Solids",
+  NULL)
+showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed")
+```
+
 ### SE Electricity
 ```{r SE Electricity}
 
diff --git a/inst/compareScenarios/cs_05_energy_demand.Rmd b/inst/compareScenarios/cs_05_energy_demand.Rmd
index 19dbca7a..0ee3806e 100644
--- a/inst/compareScenarios/cs_05_energy_demand.Rmd
+++ b/inst/compareScenarios/cs_05_energy_demand.Rmd
@@ -25,6 +25,81 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
 showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
 ```
 
+### FE Non-Electric Demand All Sectors - Bar 
+
+```{r FE Non-Electric Demand All Sectors - Bar}
+items <- c(
+  "FE|Hydrogen",
+  "FE|Heat",
+  "FE|Gases",
+  "FE|Liquids",
+  "FE|Solids",
+  NULL
+)
+
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
+```
+
+
+### FE Demand Detail - Carrier and Sector - Bar
+
+```{r Final Energy Detail}
+tot <- "FE"
+items <- c(
+  "FE|Transport|Electricity",
+  "FE|Buildings|Electricity",
+  "FE|Industry|Electricity",
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
+```
+
+### FE Demand Detail - Carrier and Sector - carrier share - Bar 
+```{r FE all sectors - carrier share - Bar  }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
+```
+
+### FE Demand Non-Electric - Carrier and Sector - Bar 
+
+```{r FE Demand Non-Electric - Carrier and Sector - Bar}
+items <- c(
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
+```
+
+
 ### FE Line Plots
 #### Electricity
 ```{r Electricity}


Reviews:
user: login: dklein-pik
body: Thank you. Just two small questions.
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-26T10:18:54Z
user: login: robertsalzwedel
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T14:33:25Z
user: login: robertsalzwedel
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T14:33:34Z

Review comments:
diff_hunk: @@ -25,6 +25,87 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
 showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
 ```
 
+### FE Non-Electric Demand All Sectors - Bar 
+
+```{r Final Energy total}
+items <- c(
+  "FE|Hydrogen",
+  "FE|Heat",
+  "FE|Gases",
+  "FE|Liquids",
+  "FE|Solids",
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
path: inst/compareScenarios/cs_05_energy_demand.Rmd
user: login: dklein-pik
body: Why is this in an individual R section?
created_at: 2025-03-26T10:18:10Z
author_association: MEMBER
diff_hunk: @@ -25,6 +25,87 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
 showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
 ```
 
+### FE Non-Electric Demand All Sectors - Bar 
+
+```{r Final Energy total}
+items <- c(
+  "FE|Hydrogen",
+  "FE|Heat",
+  "FE|Gases",
+  "FE|Liquids",
+  "FE|Solids",
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
+```
+
+
+### FE Demand Detail - Carrier and Sector - Bar
+
+```{r Final Energy Detail}
+tot <- "FE"
+items <- c(
+  "FE|Transport|Electricity",
+  "FE|Buildings|Electricity",
+  "FE|Industry|Electricity",
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
+```
+
+### FE Demand Detail - Carrier and Sector - carrier share - Bar 
+```{r FE all sectors - carrier share - Bar  }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
+```
+
+### FE Demand Non-Electric - Carrier and Sector - Bar 
+
+```{r Final Energy Non-Electricity Detail}
+items <- c(
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+```
+
+
+```{r FE Non-Electricity all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
path: inst/compareScenarios/cs_05_energy_demand.Rmd
user: login: dklein-pik
body: Why is this in an individual R section?
created_at: 2025-03-26T10:18:35Z
author_association: MEMBER
diff_hunk: @@ -25,6 +25,87 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
 showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
 ```
 
+### FE Non-Electric Demand All Sectors - Bar 
+
+```{r Final Energy total}
+items <- c(
+  "FE|Hydrogen",
+  "FE|Heat",
+  "FE|Gases",
+  "FE|Liquids",
+  "FE|Solids",
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
+```
+
+
+### FE Demand Detail - Carrier and Sector - Bar
+
+```{r Final Energy Detail}
+tot <- "FE"
+items <- c(
+  "FE|Transport|Electricity",
+  "FE|Buildings|Electricity",
+  "FE|Industry|Electricity",
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
+```
+
+### FE Demand Detail - Carrier and Sector - carrier share - Bar 
+```{r FE all sectors - carrier share - Bar  }
+showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
+```
+
+### FE Demand Non-Electric - Carrier and Sector - Bar 
+
+```{r Final Energy Non-Electricity Detail}
+items <- c(
+  "FE|Transport|Hydrogen",
+  "FE|Buildings|Hydrogen",
+  "FE|Industry|Hydrogen", 
+  "FE|Buildings|Heat",
+  "FE|Industry|Heat", 
+  "FE|Transport|Gases",
+  "FE|Buildings|Gases",
+  "FE|Industry|Gases", 
+  "FE|Transport|Liquids",
+  "FE|Buildings|Liquids",
+  "FE|Industry|Liquids", 
+  "FE|Buildings|Solids",
+  "FE|Industry|Solids", 
+  NULL
+)
+```
+
+
+```{r FE Non-Electricity all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
path: inst/compareScenarios/cs_05_energy_demand.Rmd
user: login: robertsalzwedel
body: I updated this. 
created_at: 2025-03-31T14:33:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -25,6 +25,87 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed")
 showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE)
 ```
 
+### FE Non-Electric Demand All Sectors - Bar 
+
+```{r Final Energy total}
+items <- c(
+  "FE|Hydrogen",
+  "FE|Heat",
+  "FE|Gases",
+  "FE|Liquids",
+  "FE|Solids",
+  NULL
+)
+```
+
+
+```{r FE all sectors by carrier - Bar }
+showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed")
path: inst/compareScenarios/cs_05_energy_demand.Rmd
user: login: robertsalzwedel
body: I updated this
created_at: 2025-03-31T14:33:34Z
author_association: CONTRIBUTOR

PR comments:
user: login: fbenke-pik
created_at: 2025-03-26T10:21:05Z
body: Don't forget to run buildLibrary
author_association: CONTRIBUTOR
user: login: robertsalzwedel
created_at: 2025-03-31T14:20:21Z
body: Thanks for the comments, @dklein-pik and @fbenke-pik!
I changed the R sections and will run buildLibrary. 
author_association: CONTRIBUTOR