-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from robinhasse/renDepth
Renovation depth
- Loading branch information
Showing
10 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#' Calculate renovation depth | ||
#' | ||
#' The renovation depth is currently calculated based on the ratio of specific | ||
#' useful energy demand after and before the renovation. This is valid under the | ||
#' assumption that there is no change in behaviour (rebound effect) which we | ||
#' currently make. Once adaptive behaviour is considered, we should use the | ||
#' ratio of U-values. | ||
#' | ||
#' @author Robin Hasse | ||
#' | ||
#' @importFrom madrat toolGetMapping | ||
#' @importFrom dplyr %>% .data left_join filter mutate select | ||
#' @importFrom magclass as.magpie collapseDim | ||
#' @export | ||
|
||
calcRenDepth <- function() { | ||
|
||
bsMap <- toolGetMapping("buildingShell.csv", "sectoral", "brick") | ||
|
||
renDepth <- expand.grid(bs = bsMap[["bs"]], | ||
bsr = c(bsMap[["bs"]], "0")) %>% | ||
left_join(bsMap, by = c("bs")) %>% | ||
left_join(bsMap, by = c(bsr = "bs"), suffix = c("Before", "After")) %>% | ||
filter(.data[["energyLadderBefore"]] >= .data[["energyLadderAfter"]] | | ||
.data[["bsr"]] == 0) %>% | ||
mutate(value = ifelse(.data[["bsr"]] == "0", | ||
0, | ||
1 - .data[["relDemAfter"]] / .data[["relDemBefore"]])) %>% | ||
select("bs", "bsr", "value") %>% | ||
as.magpie() %>% | ||
collapseDim() | ||
|
||
return(list(x = renDepth, | ||
isocountries = FALSE, | ||
min = 0, | ||
max = 1, | ||
unit = "1", | ||
description = "Renovation depth")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
typ, typHotmaps | ||
SFH,Residential sector|Single family- Terraced houses|Single family- Terraced houses | ||
MFH,Residential sector|Appartment blocks|Appartment blocks | ||
MFH,Residential sector|Multifamily houses|Multifamily houses | ||
Com,Service sector|Total|Total |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.