diff --git a/.buildlibrary b/.buildlibrary index 656c5437..bbf52269 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '8599325045' +ValidationKey: '1002450' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index d1fffded..34799ebf 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'mrindustry: input data generation for the REMIND industry module' -version: 0.4.2.9001 -date-released: '2024-11-18' +version: 0.5.0 +date-released: '2024-11-22' abstract: The mrindustry packages contains data preprocessing for the REMIND model. authors: - family-names: Benke diff --git a/DESCRIPTION b/DESCRIPTION index fa4162e4..8faf0ac7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrindustry Title: input data generation for the REMIND industry module -Version: 0.4.2.9001 -Date: 2024-11-18 +Version: 0.5.0 +Date: 2024-11-22 Authors@R: c( person(given = "Falk", family = "Benke", email = "benke@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/calcFeDemandIndustry.R b/R/calcFeDemandIndustry.R index 66598f83..c90572d1 100644 --- a/R/calcFeDemandIndustry.R +++ b/R/calcFeDemandIndustry.R @@ -1,5 +1,6 @@ #' Calculates FE demand in industry as REMIND variables #' +#' @md #' @param use_ODYM_RECC per-capita pathways for `SDP_xx` scenarios? (Defaults #' to `FALSE`.) #' @param last_empirical_year Last year for which empirical data is available. @@ -1041,6 +1042,49 @@ calcFeDemandIndustry <- function(use_ODYM_RECC = FALSE, ungroup() %>% select(-"value") + ### modify subsector FE share targets ---- + # Default data with no modification will reduce the solids share of other + # industry in the Non-OECD region by ten percentage points, and increase the + # electricity share by as much. The changes are phased in over the time + # horizon of IEA ETP data (2025–60). + IEA_ETP_Ind_FE_shares_delta <- tribble( + ~region, ~subsector, ~fety, ~share.delta, + 'Non-OECD', 'otherInd', 'feel', 0.1, + 'Non-OECD', 'otherInd', 'feso', -0.1) + + # verify modification sums + IEA_ETP_Ind_FE_shares_delta %>% + group_by(.data$region, .data$subsector) %>% + summarise(share.delta.sum = sum(.data$share.delta), .groups = 'drop') %>% + verify(0 == .data$share.delta.sum) %>% + invisible() + + IEA_ETP_Ind_FE_shares <- IEA_ETP_Ind_FE_shares %>% + left_join( + # expand modifications to phase in from 0 to full over the time horizon of + # IEA_ETP_Ind_FE_shares + IEA_ETP_Ind_FE_shares_delta %>% + left_join( + IEA_ETP_Ind_FE_shares %>% + select(-'share') %>% + filter(.data$year %in% range(.data$year)), + + c('region', 'subsector', 'fety') + ) %>% + mutate(share.delta = ifelse(min(.data$year) == .data$year, + 0, + .data$share.delta)) %>% + interpolate_missing_periods(year = unique(IEA_ETP_Ind_FE_shares$year), + value = 'share.delta'), + + c('region', 'subsector', 'fety', 'year'), + + ) %>% + replace_na(list(share.delta = 0)) %>% + # add share modifications + mutate(share = .data$share + .data$share.delta) %>% + select(-'share.delta') + ### split feel shares and extend to SSP scenarios ---- IEA_ETP_Ind_FE_shares <- bind_rows( # all pf that don't need splitting diff --git a/README.md b/README.md index eb980311..d4819beb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # input data generation for the REMIND industry module -R package **mrindustry**, version **0.4.2.9001** +R package **mrindustry**, version **0.5.0** [![CRAN status](https://www.r-pkg.org/badges/version/mrindustry)](https://cran.r-project.org/package=mrindustry) [![R build status](https://github.com/pik-piam/mrindustry/workflows/check/badge.svg)](https://github.com/pik-piam/mrindustry/actions) [![codecov](https://codecov.io/gh/pik-piam/mrindustry/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrindustry) [![r-universe](https://pik-piam.r-universe.dev/badges/mrindustry)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Falk Benke To cite package **mrindustry** in publications use: -Benke F, Dürrwächter J, Rodrigues R, Moreno-Leiva S, Baumstark L, Pehl M (2024). _mrindustry: input data generation for the REMIND industry module_. R package version 0.4.2.9001, . +Benke F, Dürrwächter J, Rodrigues R, Moreno-Leiva S, Baumstark L, Pehl M (2024). _mrindustry: input data generation for the REMIND industry module_. R package version 0.5.0, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrindustry: input data generation for the REMIND industry module}, author = {Falk Benke and Jakob Dürrwächter and Renato Rodrigues and Simón Moreno-Leiva and Lavinia Baumstark and Michaja Pehl}, year = {2024}, - note = {R package version 0.4.2.9001}, + note = {R package version 0.5.0}, url = {https://github.com/pik-piam/mrindustry}, } ``` diff --git a/man/calcFeDemandIndustry.Rd b/man/calcFeDemandIndustry.Rd index 416d4517..6625a916 100644 --- a/man/calcFeDemandIndustry.Rd +++ b/man/calcFeDemandIndustry.Rd @@ -7,8 +7,8 @@ calcFeDemandIndustry(use_ODYM_RECC = FALSE, last_empirical_year = 2020) } \arguments{ -\item{use_ODYM_RECC}{per-capita pathways for `SDP_xx` scenarios? (Defaults -to `FALSE`.)} +\item{use_ODYM_RECC}{per-capita pathways for \code{SDP_xx} scenarios? (Defaults +to \code{FALSE}.)} \item{last_empirical_year}{Last year for which empirical data is available. Defaults to 2020.}