Skip to content

Commit

Permalink
Merge pull request #99 in JGCRI/gcam-core from plp/bugfix/dplyr-0.8.0…
Browse files Browse the repository at this point in the history
….1 to master

* commit '544f406c2bc6c6db47ad2bc4969fb63cd587d953':
  Some fixes for dplyr 0.8.0.1 having to do with mutate_if and select_if. This fixes are backwards compatible with older versions of dplyr.
  • Loading branch information
pralitp committed Feb 22, 2019
2 parents e585cf7 + 544f406 commit 46997cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions input/gcamdata/R/zchunk_L103.ghg_an_USA_S_T_Y.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module_emissions_L103.ghg_an_USA_S_T_Y <- function(command, ...) {
group_by(sector, fuel) %>%
summarize_if(is.numeric, sum, na.rm = TRUE) %>%
filter(!is.na(sector), !is.na(fuel)) %>%
ungroup() %>%
mutate_all( funs( replace(., is.na(.), 0))) %>%
mutate_if(is.numeric, funs(. * CONV_GG_TG)) ->
L103.ghg_tg_USA_an_Sepa_F_2005
Expand Down
2 changes: 1 addition & 1 deletion input/gcamdata/R/zchunk_L254.transportation_USA.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ module_gcam.usa_L254.transportation_USA <- function(command, ...) {
# Model may make up calibration values otherwise.
L254.StubTranTechCoef_USA %>%
filter(year %in% MODEL_BASE_YEARS) %>%
select_if(names(L254.StubTranTechCoef_USA) %in% LEVEL2_DATA_NAMES[["StubTranTechCalInput"]]) %>%
select(names(.)[names(.) %in% LEVEL2_DATA_NAMES[["StubTranTechCalInput"]]]) %>%
left_join(L254.StubTranTechCalInput_USA,
by = c("region", "supplysector", "tranSubsector", "stub.technology", "year", "minicam.energy.input")) %>%
# Set calibration values as zero for technolgies that do not exist in some base years
Expand Down

0 comments on commit 46997cf

Please sign in to comment.