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

read in IEA Energy Efficiency Indicators database #111

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

fbenke-pik
Copy link
Contributor

No description provided.

@fbenke-pik fbenke-pik requested a review from robinhasse April 17, 2024 15:07
@robinhasse
Copy link
Contributor

Sorry for bringing up the source name again. But I was wondering, if IEA_EEI was preferable as we seem to use this kind of abbreviation for all IEA sources. But I have no strong feelings about that.

Copy link
Contributor

@robinhasse robinhasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much, Falk! Looks good. Please just consider my proposal for the dimension names and the source name. If you are indifferent about the latter, let's please change it to IEA_EEI.

for (domain in c("INDUSTRY", "TRANSPORT", "RESIDENTIAL", "SERVICES")) {
data <- rbind(data, fread(
file = file.path("2023", paste0("IEA - EEI ", domain, ".TXT")),
col.names = c("CARBON_INDICATOR", "END_USE", "TIME", "COUNTRY", "VALUE"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
col.names = c("CARBON_INDICATOR", "END_USE", "TIME", "COUNTRY", "VALUE"),
col.names = c("ITEM", "ENDUSE", "TIME", "COUNTRY", "VALUE"),

I suggest different dimension names. This is tricky, as IEA mixes very different types of data:

  • col.names[1]: Indicators, Activity, Products --> ITEM
  • col.names[2]: End use, blank for activity --> ENDUSE

Comment on lines 4 to 5
#' @importFrom data.table fread :=
#' @importFrom dplyr %>% filter mutate distinct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#' @importFrom data.table fread :=
#' @importFrom dplyr %>% filter mutate distinct
#' @importFrom data.table fread
#' @importFrom dplyr %>% filter mutate distinct
#' @importFrom magclass as.magpie

#'
#' @author Falk Benke
#' @param x MAgPIE object to be converted
#' @importFrom madrat toolCountry2isocode toolCountryFill
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#' @importFrom madrat toolCountry2isocode toolCountryFill
#' @importFrom madrat toolCountry2isocode toolCountryFill
#' @importFrom magclass getItems getItems<-

@fbenke-pik fbenke-pik requested a review from robinhasse April 18, 2024 08:50
Copy link
Contributor

@robinhasse robinhasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick implementation!

@fbenke-pik fbenke-pik merged commit d67458b into pik-piam:master Apr 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants