Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and fix plots for CompScen transport #25

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '999300'
ValidationKey: '1019439'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'reporttransport: Reporting package for edgeTransport'
version: 0.5.0
date-released: '2024-09-20'
version: 0.5.1
date-released: '2024-09-23'
abstract: This package contains edgeTransport-specific routines to report model results.
The main functionality is to generate transport reporting variables in MIF format
from a given edgeTransport model run folder or REMIND input data.
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: reporttransport
Title: Reporting package for edgeTransport
Version: 0.5.0
Date: 2024-09-20
Version: 0.5.1
Date: 2024-09-23
Authors@R:
person("Johanna", "Hoppe", , "[email protected]", role = c("aut", "cre"))
Description: This package contains edgeTransport-specific routines to
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reporting package for edgeTransport

R package **reporttransport**, version **0.5.0**
R package **reporttransport**, version **0.5.1**

[![CRAN status](https://www.r-pkg.org/badges/version/reporttransport)](https://cran.r-project.org/package=reporttransport) [![R build status](https://github.com/pik-piam/reporttransport/workflows/check/badge.svg)](https://github.com/pik-piam/reporttransport/actions) [![codecov](https://codecov.io/gh/pik-piam/reporttransport/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/reporttransport) [![r-universe](https://pik-piam.r-universe.dev/badges/reporttransport)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -41,7 +41,7 @@ In case of questions / problems please contact Johanna Hoppe <johanna.hoppe@pik-

To cite package **reporttransport** in publications use:

Hoppe J (2024). _reporttransport: Reporting package for edgeTransport_. R package version 0.5.0, <https://github.com/pik-piam/reporttransport>.
Hoppe J (2024). _reporttransport: Reporting package for edgeTransport_. R package version 0.5.1, <https://github.com/pik-piam/reporttransport>.

A BibTeX entry for LaTeX users is

Expand All @@ -50,7 +50,7 @@ A BibTeX entry for LaTeX users is
title = {reporttransport: Reporting package for edgeTransport},
author = {Johanna Hoppe},
year = {2024},
note = {R package version 0.5.0},
note = {R package version 0.5.1},
url = {https://github.com/pik-piam/reporttransport},
}
```
76 changes: 49 additions & 27 deletions inst/compareScenarios/cs_02_energy_services.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Energy Services
## Passenger without bunkers
```{r}
totWoBunk <- "ES|Transport edge|Pass"
items <- c(
"ES|Transport|Pass|Domestic Aviation",
"ES|Transport|Pass|Rail|HSR",
"ES|Transport|Pass|Rail|non-HSR",
"ES|Transport|Pass|Road|Bus",
"ES|Transport|Pass|Road|LDV|Four Wheelers",
"ES|Transport|Pass|Road|LDV|Two Wheelers",
"ES|Transport|Pass|Non-motorized|Walk",
"ES|Transport|Pass|Non-motorized|Cycle"
)
showAreaAndBarPlots(data, items, totWoBunk, orderVars = "user")
showAreaAndBarPlots(data, items, totWoBunk, fill = TRUE, orderVars = "user")
```

## Passenger with bunkers
```{r}
tot_wbunk <- "ES|Transport|Pass with bunkers"
tot_wobunk <- "ES|Transport edge|Pass"
totBunk <- "ES|Transport|Pass with bunkers"
items <- c(
"ES|Transport|Bunkers|Pass|International Aviation",
"ES|Transport|Pass|Domestic Aviation",
Expand All @@ -14,12 +30,11 @@ items <- c(
"ES|Transport|Pass|Non-motorized|Walk",
"ES|Transport|Pass|Non-motorized|Cycle"
)
showAreaAndBarPlots(data, items, tot_wbunk, orderVars = "user")
showAreaAndBarPlots(data, items[2:9], tot_wobunk, orderVars = "user")
showAreaAndBarPlots(data, items, tot_wbunk, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items[2:9], tot_wobunk, fill=TRUE, orderVars = "user")
showLinePlots(data, tot_wbunk)
walk(c( "ES|Transport|Pass|Aviation", tot_wobunk, items[1:5], "ES|Transport|Pass|Road|LDV", items[6:9]), showLinePlots, data = data)
showAreaAndBarPlots(data, items, totBunk, orderVars = "user")
showAreaAndBarPlots(data, items, totBunk, fill = TRUE, orderVars = "user")
showLinePlots(data, totBunk)
walk(c("ES|Transport|Pass|Aviation", totWoBunk, items[1:5], "ES|Transport|Pass|Road|LDV", items[6:9]),
showLinePlots, data = data)
```

## Passenger per Capita
Expand All @@ -38,7 +53,7 @@ items <- c(
"ES|Transport|Pass|Non-motorized|Walk pCap",
"ES|Transport|Pass|Non-motorized|Cycle pCap"
)
showMultiLinePlots(data, items)
showMultiLinePlots(data, items)
showMultiLinePlotsByVariable(data, items, "GDP|PPP pCap")
walk(items, showLinePlotsByVariable, data = data, xVar = "GDP|PPP pCap")
```
Expand Down Expand Up @@ -70,19 +85,19 @@ items <- c(
)

showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV 2-Wheelers by technology
```{r}
tot <- "ES|Transport|Pass|Road|LDV|Two Wheelers"
items <- c(
"ES|Transport|Pass|Road|LDV|Two Wheelers|BEV",
"ES|Transport|Pass|Road|LDV|Two Wheelers|Liquids"
"ES|Transport|Pass|Road|LDV|Two Wheelers|Liquids"
)

showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Busses by technology
Expand All @@ -92,33 +107,41 @@ items <- c(
"ES|Transport|Pass|Road|Bus|BEV",
"ES|Transport|Pass|Road|Bus|FCEV",
"ES|Transport|Pass|Road|Bus|Gases",
"ES|Transport|Pass|Road|Bus|Liquids"
"ES|Transport|Pass|Road|Bus|Liquids"
)

showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Freight without bunkers
```{r}
totWoBunk <- "ES|Transport edge|Freight"
items <- c(
"ES|Transport|Freight|Domestic Shipping",
"ES|Transport|Freight|Rail",
"ES|Transport|Freight|Road"
)
showAreaAndBarPlots(data, items, totWoBunk, orderVars = "user")
showAreaAndBarPlots(data, items, totWoBbunk, fill = TRUE, orderVars = "user")
```

## Freight with bunkers
```{r}
tot_wbunk <- "ES|Transport|Freight with bunkers"
tot_wobunk <- "ES|Transport|Freight"
totBunk <- "ES|Transport|Freight with bunkers"
items <- c(
"ES|Transport|Bunkers|Freight|International Shipping",
"ES|Transport|Freight|Domestic Shipping",
"ES|Transport|Freight|Rail",
"ES|Transport|Freight|Road"
)
showAreaAndBarPlots(data, items, tot_wbunk, orderVars = "user")
showAreaAndBarPlots(data, items[2:4], tot_wobunk, orderVars = "user")
showAreaAndBarPlots(data, items, tot_wbunk, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items[2:4], tot_wobunk, fill=TRUE, orderVars = "user")
showLinePlots(data, tot_wbunk)
walk(items, showLinePlots, data=data)
showAreaAndBarPlots(data, items, totBunk, orderVars = "user")
showAreaAndBarPlots(data, items, totBunk, fill = TRUE, orderVars = "user")
showLinePlots(data, totBunk)
walk(items, showLinePlots, data = data)
```



## Freight per Capita
```{r}

Expand All @@ -129,10 +152,9 @@ items <- c(
"ES|Transport|Freight|Rail pCap",
"ES|Transport|Freight|Road pCap"
)
showMultiLinePlots(data, items)
showMultiLinePlots(data, items)
showMultiLinePlotsByVariable(data, items, "GDP|PPP pCap")
walk(items, showLinePlotsByVariable, data = data, xVar = "GDP|PPP pCap")

```

## Trucks
Expand All @@ -149,7 +171,7 @@ items <- c(
)

showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

### By technology
Expand All @@ -163,6 +185,6 @@ items <- c(
)

showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill=TRUE, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

66 changes: 56 additions & 10 deletions inst/compareScenarios/cs_04_stock_and_sales.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
```{r}
tot <- "Stock|Transport|Pass|Road|LDV"
items <- c("Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|LargeCar and SUV",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car and SUV",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|Van",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Medium|Compact Car",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Medium|Midsize Car",
Expand All @@ -15,7 +15,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Sales by vehicle size
## LDV Sales by vehicle size
```{r}
tot <- "Sales|Transport|Pass|Road|LDV"
items <- c("Sales|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car",
Expand All @@ -32,6 +32,30 @@ showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")

## LDV Stock by technology
```{r}
tot <- "Stock|Transport|Pass|Road|LDV"
items <- c("Stock|Transport|Pass|Road|LDV|BEV",
"Stock|Transport|Pass|Road|LDV|FCEV",
"Stock|Transport|Pass|Road|LDV|Hybrid electric",
"Stock|Transport|Pass|Road|LDV|Liquids",
"Stock|Transport|Pass|Road|LDV|Gases")
showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Sales by technology
```{r}
tot <- "Sales|Transport|Pass|Road|LDV"
items <- c("Sales|Transport|Pass|Road|LDV|BEV",
"Sales|Transport|Pass|Road|LDV|FCEV",
"Sales|Transport|Pass|Road|LDV|Hybrid electric",
"Sales|Transport|Pass|Road|LDV|Liquids",
"Sales|Transport|Pass|Road|LDV|Gases")
showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Stock by technology - Subcompact Car
```{r}
tot <- "Stock|Transport|Pass|Road|LDV|Four Wheelers|Small|Subcompact Car"
items <- c("Stock|Transport|Pass|Road|LDV|Four Wheelers|Small|Subcompact Car|BEV",
"Stock|Transport|Pass|Road|LDV|Four Wheelers|Small|Subcompact Car|FCEV",
Expand All @@ -42,7 +66,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Sales by technology
## LDV Sales by technology - Subcompact Car
```{r}
tot <- "Sales|Transport|Pass|Road|LDV|Four Wheelers|Small|Subcompact Car"
items <- c("Sales|Transport|Pass|Road|LDV|Four Wheelers|Small|Subcompact Car|BEV",
Expand All @@ -54,7 +78,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Stock by technology
## LDV Stock by technology - Large Car and SUV
```{r}
tot <- "Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car and SUV"
items <- c("Stock|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car and SUV|BEV",
Expand All @@ -66,7 +90,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## LDV Sales by technology
## LDV Sales by technology - Large Car and SUV
```{r}
tot <- "Sales|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car and SUV"
items <- c("Sales|Transport|Pass|Road|LDV|Four Wheelers|Large|Large Car and SUV|BEV",
Expand All @@ -78,7 +102,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Busses
## Busses Stock by technology
```{r}
tot <- "Stock|Transport|Pass|Road|Bus"
items <- c("Stock|Transport|Pass|Road|Bus|BEV",
Expand Down Expand Up @@ -113,7 +137,29 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Small Truck stock by technology
## Truck stock by technology
```{r}
tot <- "Stock|Transport|Freight|Road"
items <- c("Stock|Transport|Freight|Road|BEV",
"Stock|Transport|Freight|Road|FCEV",
"Stock|Transport|Freight|Road|Liquids",
"Stock|Transport|Freight|Road|Gases")
showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Truck sales by technology
```{r}
tot <- "Sales|Transport|Freight|Road"
items <- c("Sales|Transport|Freight|Road|BEV",
"Sales|Transport|Freight|Road|FCEV",
"Sales|Transport|Freight|Road|Liquids",
"Sales|Transport|Freight|Road|Gases")
showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Truck stock by technology - small
```{r}
tot <- "Stock|Transport|Freight|Road|Light|Truck(0-3_5t)"
items <- c("Stock|Transport|Freight|Road|Light|Truck(0-3_5t)|BEV",
Expand All @@ -124,7 +170,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Small Truck sales by technology
## Truck sales by technology - small
```{r}
tot <- "Sales|Transport|Freight|Road|Light|Truck(0-3_5t)"
items <- c("Sales|Transport|Freight|Road|Light|Truck(0-3_5t)|BEV",
Expand All @@ -135,7 +181,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Large Truck stock by technology
## Truck stock by technology - large
```{r}
tot <- "Stock|Transport|Freight|Road|Heavy|Truck(40t)"
items <- c("Stock|Transport|Freight|Road|Heavy|Truck(40t)|BEV",
Expand All @@ -146,7 +192,7 @@ showAreaAndBarPlots(data, items, tot, orderVars = "user")
showAreaAndBarPlots(data, items, tot, fill = TRUE, orderVars = "user")
```

## Large Truck sales by technology
## Truck sales by technology - large
```{r}
tot <- "Sales|Transport|Freight|Road|Heavy|Truck(40t)"
items <- c("Sales|Transport|Freight|Road|Heavy|Truck(40t)|BEV",
Expand Down