-
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.
- Loading branch information
1 parent
348472b
commit 4da9a32
Showing
11 changed files
with
87 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Type: Package | |
Package: mredgebuildings | ||
Title: Prepare data to be used by the EDGE-Buildings model | ||
Version: 0.3.0 | ||
Date: 2023-06-23 | ||
Date: 2023-06-29 | ||
Authors@R: c( | ||
person("Robin", "Hasse", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-1818-3186")), | ||
|
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,26 @@ | ||
#' Convert European district heating prices | ||
#' | ||
#' We should consider prper extrapolation | ||
#' | ||
#' @author Robin Hasse | ||
#' | ||
#'@param x MAgPIE object with original district heating prices | ||
#' | ||
#' @importFrom madrat toolCountry2isocode toolCountryFill | ||
#' @importFrom magclass getItems<- getItems collapseDim | ||
#' @export | ||
|
||
convertEnergiforsk2016 <- function(x) { | ||
|
||
data <- x | ||
|
||
# rename regions: ISO2 -> ISO3 | ||
getItems(data, 1) <- toolCountry2isocode(getItems(data, 1)) | ||
|
||
# fill missing countries with NA | ||
data <- data %>% | ||
collapseDim() %>% | ||
toolCountryFill(verbosity = 2) | ||
|
||
return(data) | ||
} |
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,21 @@ | ||
#' Read European district heating prices | ||
#' | ||
#' @author Robin Hasse | ||
#' | ||
#' @importFrom utils read.csv | ||
#' @importFrom tidyr pivot_longer | ||
#' @importFrom dplyr select matches mutate rename | ||
#' @importFrom quitte as.quitte | ||
#' @importFrom magclass as.magpie | ||
#' @export | ||
|
||
readEnergiforsk2016 <- function() { | ||
file <- "european-district-heating-price-series-energiforskrapport-2016-316.csv" | ||
read.csv(file, skip = 1) %>% | ||
select(-matches("All\\.countries")) %>% | ||
pivot_longer(-"Year", names_to = "region", values_to = "value") %>% | ||
mutate(region = gsub("\\.", " ", .data[["region"]])) %>% | ||
rename(period = "Year") %>% | ||
as.quitte() %>% | ||
as.magpie() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.