Skip to content

Commit

Permalink
for sectoral FE pGDP plots, only change documentation and variable na…
Browse files Browse the repository at this point in the history
…mes so it is more obvious that it is divided by GDP_PPP not GDP_MER
  • Loading branch information
Chen Gong committed Dec 13, 2023
1 parent b47cab2 commit dd0eba8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions inst/markdown/compareScenarios2/cs2_02_macro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -206,25 +206,25 @@ walk(vars, showLinePlots, data = data)

## FE intensity of GDP

```{r FE intensity of GDP}
```{r FE intensity of GDP_PPP}
items <- c(
"FE|Transport pGDP",
"FE|Buildings pGDP",
"FE|Industry pGDP")
"FE|Transport pGDP_PPP",
"FE|Buildings pGDP_PPP",
"FE|Industry pGDP_PPP")
showAreaAndBarPlots(data, items, scales = "fixed")
```

## FE intensity of GDP, linegraph (by GDP)
## FE intensity of GDP_PPP, linegraph (by pGDP_PPP)

```{r FE intensity of GDP, linegraph}
```{r FE intensity of GDP_PPP, linegraph}
dIea <-
data %>%
# To make the plots less crowded, show only IEA historical data.
filter(scenario != "historical" | model == "IEA")
items <- c(
"FE|Transport pGDP",
"FE|Buildings pGDP",
"FE|Industry pGDP")
"FE|Transport pGDP_PPP",
"FE|Buildings pGDP_PPP",
"FE|Industry pGDP_PPP")
showMultiLinePlots(dIea, items, scales = "fixed")
showMultiLinePlotsByVariable(dIea, items, "GDP|PPP pCap", scales = "fixed")
```
Expand Down
10 changes: 5 additions & 5 deletions inst/markdown/compareScenarios2/cs2_main.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ data <-
```


```{r calculate pGDP variables}
```{r calculate pGDP_PPP variables}
dataGDP <-
data %>%
filter(variable == "GDP|PPP pCap") %>%
Expand All @@ -345,10 +345,10 @@ dataGDP <-
rename(gdp = value)
# For all variables in following table, add a new variable to data with the name
# "OldName pGDP". Calculate its value by
# "OldName pGDP_PPP". Calculate its value by
# OldValue / (GDP|PPP pCap) * conversionFactor
# and set its unit to newUnit.
# The new variable "OldName pGDP" will be available in the plot sections.
# The new variable "OldName pGDP_PPP" will be available in the plot sections.
pGdpVariables <- tribble(
~variable, ~newUnit, ~conversionFactor,
"FE", "MJ/US$2005", 1e3,
Expand All @@ -363,8 +363,8 @@ dataPGdp <-
left_join(dataGDP, c("scenario", "region", "period")) %>%
mutate(
value = value / gdp * conversionFactor,
variable = paste0(variable, " pGDP"),
varplus = paste0(varplus, " pGDP"),
variable = paste0(variable, " pGDP_PPP"),
varplus = paste0(varplus, " pGDP_PPP"),
unit = newUnit,
newUnit = NULL, conversionFactor = NULL, gdp = NULL)
Expand Down

0 comments on commit dd0eba8

Please sign in to comment.