-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
*_Rmd/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Type: Package | ||
Package: reportbrick | ||
Title: Reporting package for BRICK | ||
Version: 0.1.1 | ||
Date: 2024-04-22 | ||
Version: 0.2.0 | ||
Date: 2024-05-07 | ||
Authors@R: | ||
person("Robin", "Hasse", , "[email protected]", | ||
role = c("aut", "cre"), | ||
|
@@ -15,6 +15,8 @@ Imports: | |
gamstransfer (>= 3.0.1), | ||
madrat, | ||
magclass, | ||
mip (>= 0.148.15), | ||
piamPlotComparison, | ||
yaml | ||
Suggests: | ||
covr, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Stock and flows | ||
|
||
## Building stock | ||
|
||
```{r stock vars} | ||
tot <- "Stock|Buildings" | ||
subsec <- c("Stock|Residential", | ||
"Stock|Commercial") | ||
``` | ||
|
||
```{r StockSubsector} | ||
showAreaAndBarPlots(data, vars = subsec, tot = tot, orderVars = "user", scales = "fixed") | ||
``` | ||
|
||
### All buildings | ||
|
||
### Residential | ||
```{r residential stock vars} | ||
tot <- "Stock|Residential" | ||
heatingRes <- paste(tot, heating, sep = "|") | ||
vintageRes <- paste(tot, vintage, sep = "|") | ||
typeRes <- paste(tot, type, sep = "|") | ||
locationRes <- paste(tot, location, sep = "|") | ||
``` | ||
|
||
#### by building type | ||
```{r Stock-Residential-(type)} | ||
showAreaAndBarPlots(data, vars = typeRes, tot = tot, orderVars = "user", scales = "fixed") | ||
walk(typeRes, showLinePlots, data = data) | ||
``` | ||
|
||
#### by location | ||
```{r Stock-Residential-(location)} | ||
showAreaAndBarPlots(data, vars = locationRes, tot = tot, orderVars = "user", scales = "fixed") | ||
walk(locationRes, showLinePlots, data = data) | ||
``` | ||
|
||
#### by construction cohort | ||
```{r Stock-Residential-(vintage)} | ||
showAreaAndBarPlots(data, vars = rev(vintageRes), tot = tot, orderVars = "user", scales = "fixed") | ||
``` | ||
|
||
#### by Space heating | ||
```{r Stock-Residential-(heating)} | ||
showAreaAndBarPlots(data, vars = heatingRes, tot = tot, orderVars = "user", scales = "fixed") | ||
walk(heatingRes, showLinePlots, data = data) | ||
``` | ||
|
||
### Commercial |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Load additional libraries ---------------------------------------------------- | ||
|
||
library(dplyr) # nolint: undesirable_function_linter. | ||
|
||
|
||
|
||
# BRICK sets ------------------------------------------------------------------- | ||
|
||
# Sets are used in Rmd files to select variables | ||
|
||
subsec <- c( | ||
"Residential", | ||
"Commercial" | ||
) | ||
type <- c( | ||
"SFH", | ||
"MFH" | ||
) | ||
location <- c( | ||
"Urban", | ||
"Rural" | ||
) | ||
heating <- c( | ||
"Biomass", | ||
"District heating", | ||
"Heat pump", | ||
"Resistive electric", | ||
"Gas", | ||
"Liquids", | ||
"Coal" | ||
) | ||
|
||
# automatic identification of vintages to allow for different model resolutions | ||
vintageRegex <- "(Before|After) \\d{4}|\\d{4} - \\d{4}" | ||
vintage <- grep(vintageRegex, unique(data[["variable"]]), value = TRUE) %>% | ||
unique() %>% | ||
sub(pattern = paste0("^.*(", vintageRegex, ").*$"), replacement = "\\1") %>% | ||
unique() | ||
vintage <- c(grep("^Before", vintage, value = TRUE), | ||
sort(grep("^\\d{4}", vintage, value = TRUE)), | ||
grep("^After", vintage, value = TRUE)) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.