diff --git a/.buildlibrary b/.buildlibrary index 79a973de..c227e38a 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '38572284' +ValidationKey: '384142370' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index 8a7b6240..ec5a8fd8 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: 'mrremind: MadRat REMIND Input Data Package' -version: 0.192.9 -date-released: '2024-09-30' +version: 0.192.10 +date-released: '2024-10-01' abstract: The mrremind packages contains data preprocessing for the REMIND model. authors: - family-names: Baumstark diff --git a/DESCRIPTION b/DESCRIPTION index 7ef934df..8c1e6c09 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrremind Title: MadRat REMIND Input Data Package -Version: 0.192.9 -Date: 2024-09-30 +Version: 0.192.10 +Date: 2024-10-01 Authors@R: c( person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = c("aut", "cre")), person("Renato", "Rodrigues", role = "aut"), diff --git a/NAMESPACE b/NAMESPACE index 04590f83..7635260f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -47,7 +47,6 @@ export(convertUBA) export(convertUNFCCC) export(convertUNIDO) export(convertUSGS) -export(filter_historical_mif) export(fullTHRESHOLDS) export(readADVANCE_WP2) export(readAGEB) diff --git a/R/calcIEA_ETP.R b/R/calcIEA_ETP.R index a3ef5a5b..ed8ce566 100644 --- a/R/calcIEA_ETP.R +++ b/R/calcIEA_ETP.R @@ -6,57 +6,110 @@ #' @author Falk Benke #' #' @importFrom dplyr select mutate left_join -#' @importFrom rlang sym -#' @importFrom stats aggregate na.pass #' @export calcIEA_ETP <- function() { + .map <- function(x, mapping) { + + data <- as.data.frame(x) %>% + as_tibble() %>% + select( + "region" = "Region", "scenario" = "Data1", "variable" = "Data2", + "year" = "Year", "value" = "Value" + ) %>% + filter(!is.na(.data$value)) + + data <- full_join(data, mapping, by = "variable", relationship = "many-to-many") %>% + filter(.data$REMIND != "") + + # composite REMIND variables that must be removed from the data, + # because we do not have all the components in the IEA data + remove <- data %>% filter(is.na(.data$value)) + + data <- data %>% + filter(!is.na(.data$value), + !(.data$REMIND %in% unique(remove$REMIND))) %>% + mutate( + "value" = .data$value * .data$Conversion, + "REMIND" = paste0(.data$REMIND, " (", .data$Unit_REMIND, ")"), + "model" = paste0("IEA ETP ", .data$scenario), + "year" = as.numeric(as.character(.data$year)) + ) %>% + select("region", "year", "model", "variable" = "REMIND", "value") + + x <- aggregate(value ~ region + year + model + variable, data, sum) %>% + as.magpie() + + return(x) + } + mapping <- toolGetMapping("Mapping_IEA_ETP.csv", type = "reportingVariables", where = "mrremind") %>% - filter(!is.na(!!sym("REMIND")), !!sym("REMIND") != "") %>% - mutate("Conversion" = as.numeric(!!sym("Conversion"))) %>% - select("variable" = "IEA_ETP", "REMIND", "Conversion", "Unit_REMIND") - - mapping$variable <- trimws(mapping$variable) - mapping$REMIND <- trimws(mapping$REMIND) - - x1 <- readSource("IEA_ETP", subtype = "industry") - x2 <- readSource("IEA_ETP", subtype = "transport") - x3 <- readSource("IEA_ETP", subtype = "buildings") - x4 <- readSource("IEA_ETP", subtype = "summary") - - data <- mbind(x1, x2, x3, x4) - - data <- as.data.frame(data) %>% - as_tibble() %>% - select( - "region" = "Region", "scenario" = "Data1", "variable" = "Data2", - "year" = "Year", "value" = "Value" - ) - - x <- left_join( - data, - mapping, - by = "variable", - relationship = "many-to-many" - ) %>% - filter(!!sym("REMIND") != "") %>% + filter(!is.na(.data$REMIND), .data$REMIND != "") %>% mutate( - "value" = !!sym("value") * !!sym("Conversion"), - "REMIND" = paste0(!!sym("REMIND"), " (", !!sym("Unit_REMIND"), ")"), - "model" = paste0("IEA ETP ", !!sym("scenario")), - "year" = as.numeric(as.character(!!sym("year"))) + "Conversion" = as.numeric(.data$Conversion), + "variable" = trimws(.data$IEA_ETP), + "REMIND" = trimws(.data$REMIND) ) %>% - select("region", "year", "model", "variable" = "REMIND", "value") + select("variable", "REMIND", "Conversion", "Unit_REMIND") + + xReg <- mbind( + readSource("IEA_ETP", subtype = "industry"), + readSource("IEA_ETP", subtype = "transport"), + readSource("IEA_ETP", subtype = "buildings"), + readSource("IEA_ETP", subtype = "summary") + ) + + dataReg <- .map(xReg, mapping) %>% + toolCountryFill(fill = NA, verbosity = 2) + + # set 0s in other CHA countries than China to approximate CHA as China + dataReg[c("HKG", "MAC", "TWN"), , ] <- 0 + + xGlo <- mbind( + readSource("IEA_ETP", subtype = "industry", convert = FALSE)["WORLD", , ], + readSource("IEA_ETP", subtype = "transport", convert = FALSE)["WORLD", , ], + readSource("IEA_ETP", subtype = "buildings", convert = FALSE)["WORLD", , ], + readSource("IEA_ETP", subtype = "summary", convert = FALSE)["WORLD", , ] + ) + + getItems(xGlo, dim = 1) <- "GLO" + dataGlo <- .map(xGlo, mapping) + + # includes global values from the original source instead of calculating + # them as the sum of all countries (as countries are incomplete) + .customAggregate <- function(x, rel, to = NULL, glo) { + x <- toolAggregate(x, rel = rel, to = to) + + if ("GLO" %in% getItems(x, dim = 1)) { + out <- new.magpie( + cells_and_regions = getItems(x, dim = 1), + years = union(getYears(x), getYears(glo)), + names = union(getNames(x), getNames(glo)), + fill = NA, + sets = names(dimnames(x)) + ) + + x <- x["GLO", , , invert = TRUE] + + out[getItems(x, dim = 1), getYears(x), getNames(x)] <- x + out["GLO", getYears(glo), getNames(glo)] <- glo + + return(out) + } else { + return(x) + } + } + + - x <- aggregate(value ~ region + year + model + variable, x, sum, na.action = na.pass) %>% - as.magpie() return(list( - x = x, + x = dataReg, weight = NULL, + aggregationFunction = .customAggregate, + aggregationArguments = list(glo = dataGlo), unit = c("EJ/yr", "Mt CO2/yr", "Mt/yr", "bn pkm/yr", "bn tkm/yr"), description = "IEA ETP projections as REMIND variables" )) - } diff --git a/R/convertIEA_ETP.R b/R/convertIEA_ETP.R index 60d5738f..08ee1da9 100644 --- a/R/convertIEA_ETP.R +++ b/R/convertIEA_ETP.R @@ -6,68 +6,28 @@ #' convertIEA_ETP <- function(x, subtype) { - getItems(x, dim = 1) <- lapply(getItems(x, dim = 1), function(y) ifelse(y == "NonOECD", "Non-OECD", y)) - - regmapping <- toolGetMapping("regionmappingIEA_ETP.csv", where = "mappingfolder", type = "regional") - + map <- toolGetMapping("regionmappingIEA_ETP.csv", where = "mrremind", type = "regional") fe <- calcOutput("FE", source = "IEA", aggregate = FALSE) - v <- magpply(x[c("OECD", "Non-OECD"), , , invert = T], function(y) all(is.na(y)), MARGIN = 3) - v.oecd.only <- getNames(x[, , v]) - - if (is.null(v.oecd.only)) { - v.full <- getNames(x) - } else { - v.full <- getNames(x[, , v.oecd.only, invert = T]) - } - # disaggregate ASEAN - x.asean <- x["ASEAN", , v.full] - m <- select(regmapping, c("EEAReg", "CountryCode")) %>% filter(!!sym("EEAReg") == "ASEAN") + x.asean <- x["ASEAN", , ] + m <- select(map, c("EEAReg", "CountryCode")) %>% filter(.data$EEAReg == "ASEAN") w <- fe[m$CountryCode, 2005, "FE|Transport (EJ/yr)"] x.asean <- toolAggregate(x.asean, m, from = "EEAReg", to = "CountryCode", weight = w) # disaggregate European Union - x.eu <- x["European Union", , v.full] - m <- select(regmapping, c("EEAReg", "CountryCode")) %>% filter(!!sym("EEAReg") == "EUR") + x.eu <- x["European Union", , ] + m <- select(map, c("EEAReg", "CountryCode")) %>% filter(.data$EEAReg == "EUR") w <- fe[m$CountryCode, 2005, "FE|Transport (EJ/yr)"] x.eu <- toolAggregate(x.eu, m, from = "EEAReg", to = "CountryCode", weight = w) - # entries that don't require disaggregation - x.ctry <- x[c("Brazil", "China", "India", "Mexico", "Russia", "South Africa", "United States"), , v.full] - getItems(x.ctry, dim = 1) <- toolCountry2isocode(getItems(x.ctry, dim = 1), warn = F) - - # disaggregate OECD data for variables with both OECD and finer regional granularity - x.oecd.other <- x[c("OECD", "Non-OECD"), , v.full] - - # get OECD/Non-OECD values not accounted for in other regions - x.oecd.other["OECD", , ] <- x.oecd.other["OECD", , ] - - dimSums(x[c("European Union", "Mexico", "United States"), , v.full], dim = 1) - x.oecd.other["Non-OECD", , ] <- x.oecd.other["Non-OECD", , ] - - dimSums(x[c("ASEAN", "Brazil", "China", "India", "Russia", "South Africa"), , v.full], dim = 1) - m <- select(regmapping, c("OECD", "CountryCode")) %>% - filter(!(!!sym("CountryCode") %in% c(getItems(x.asean, dim = 1), getItems(x.eu, dim = 1), getItems(x.ctry, dim = 1)))) - w <- fe[m$CountryCode, 2005, "FE|Transport (EJ/yr)"] - x.oecd.other <- toolAggregate(x.oecd.other, m, from = "OECD", to = "CountryCode", weight = w) - - x.full <- new.magpie(getISOlist(), getYears(x), names = getNames(x), fill = 0) + # transform entries that don't require disaggregation + x.ctry <- x[c("Brazil", "China", "India", "Mexico", "Russia", "South Africa", "United States"), , ] + getItems(x.ctry, dim = 1) <- toolCountry2isocode(getItems(x.ctry, dim = 1), warn = FALSE) - # for variables with only OECD/nonOECD data we disaggregate this to country-level - if (!is.null(v.oecd.only)) { - w <- fe[regmapping$CountryCode, 2005, "FE|Transport (EJ/yr)"] - x.oecd <- x[c("OECD", "Non-OECD"), , v.oecd.only] - x.oecd <- toolAggregate(x.oecd, regmapping, from = "OECD", to = "CountryCode", weight = w) - x.full[getItems(x.oecd, dim = 1), , v.oecd.only] <- x.oecd - } - # for variables with OECD/nonOECD data and addtl. region and country data - # 1) we disaggregate the more fine-granular regions ASEAN and European Union first - # 2) then calculate the values for the OECD/nonOECD regions minus the values for explicitly listed countries/regions - # and disaggregate them to the countries not listed explicitly - x.full[getItems(x.asean, dim = 1), , v.full] <- x.asean - x.full[getItems(x.eu, dim = 1), , v.full] <- x.eu - x.full[getItems(x.ctry, dim = 1), , v.full] <- x.ctry - x.full[getItems(x.oecd.other, dim = 1), , v.full] <- x.oecd.other + x <- mbind(x.asean, x.eu, x.ctry) + x <- toolCountryFill(x, fill = NA, verbosity = 2) - return(x.full) + return(x) } diff --git a/R/filter_historical_mif.R b/R/filter_historical_mif.R deleted file mode 100644 index c86d3f27..00000000 --- a/R/filter_historical_mif.R +++ /dev/null @@ -1,71 +0,0 @@ -#' Filter improperly aggregated regional data from historical.mif -#' -#' Load a `historical.mif` file, remove designated data, write back to file. -#' -#' For all combinations of scenario, model, and variable (and all years), either -#' all regions listed in `exclude_regions` in the `filter_table` are removed, or -#' all regions _except_ those listed in `include_regions` in the `filter_table` -#' are removed. -#' Defining both `include_regions` and `exclude_regions` on the same row of -#' `filter_table` will throw an error. -#' Scenarios, models, and variables are matched precisely, not partially or via -#' regular expressions. -#' -#' @md -#' @param path Path to `historical.mif` (or any mif for that matter), defaults -#' to `historical.mif` in the currently configured -#' `getConfig('outputfolder')`. -#' @param filter_table Data frame with columns `scenario`, `model`, `variable`, -#' `include_regions`, and `exclude_regions`. Defaults to the built-in -#' `./inst/extdata/historical_mif_filter_table.csv` of the `mrremind` package. -#' -#' @importFrom quitte cartesian - -#' @export -filter_historical_mif <- function(path = NULL, filter_table = NULL) { - if (is.null(path)) - path <- 'historical.mif' - - if (is.null(filter_table)) - filter_table <- read.csv( - file = system.file('extdata', 'historical_mif_filter_table.csv', - package = 'mrremind', mustWork = TRUE), - colClasses = 'character') - - # combine scenario, model, and variable columns to string for indexing a - # magpie object - scenario_model_variable <- sapply( - seq_len(nrow(filter_table)), - function(i) { - Reduce(f = cartesian, - x = filter_table[i, c('scenario', 'model', 'variable')]) - }) - - # check for conflicting include/exclude definitions - include_and_exclude <- ( '' != filter_table[['include_regions']] - & '' != filter_table[['exclude_regions']]) - - if (any(include_and_exclude)) - stop('Both include and exclude regions defined for:', - paste(c('', scenario_model_variable[include_and_exclude]), - collapse = '\n')) - - h <- read.report(file = path, as.list = FALSE) - - # process each row of the filter table - for (i in seq_len(nrow(filter_table))) { - if ('' != filter_table[[i, 'include_regions']]) { - excludedRegions <- setdiff(getItems(h, dim = 'region'), - filter_table[[i, 'include_regions']]) - } else { - excludedRegions <- filter_table[[i, 'exclude_regions']] - } - - h_include <- h[, , scenario_model_variable[i]] - h_include[excludedRegions, , ] <- NA - - h <- mbind(h[, , scenario_model_variable[i], invert = TRUE], h_include) - } - - write.report(h, file = path) -} diff --git a/R/fullVALIDATIONREMIND.R b/R/fullVALIDATIONREMIND.R index c9e8da17..1c3e926b 100644 --- a/R/fullVALIDATIONREMIND.R +++ b/R/fullVALIDATIONREMIND.R @@ -259,7 +259,4 @@ fullVALIDATIONREMIND <- function(rev = 0) { try = FALSE, years = years, writeArgs = list(scenario = "historical", model = "INDSTAT2") ) - - # filter variables that are too imprecise on regional level ---- - filter_historical_mif() } diff --git a/R/readEuropeanEnergyDatasheets.R b/R/readEuropeanEnergyDatasheets.R index 5fa229bf..3bb72574 100644 --- a/R/readEuropeanEnergyDatasheets.R +++ b/R/readEuropeanEnergyDatasheets.R @@ -15,7 +15,7 @@ #' or "EU27" (latest data from August 23 without GBR) #' @importFrom tidyr drop_na extract #' @importFrom readxl excel_sheets read_excel -#' @importFrom stats aggregate +#' @importFrom stats aggregate na.pass #' readEuropeanEnergyDatasheets <- function(subtype) { if (!subtype %in% c("EU27", "EU28")) { diff --git a/R/readIEA_ETP.R b/R/readIEA_ETP.R index ee3adbc2..1de20602 100644 --- a/R/readIEA_ETP.R +++ b/R/readIEA_ETP.R @@ -19,7 +19,7 @@ readIEA_ETP <- function(subtype) { file = "ETP2017_industry_summary.xlsx", prefix = "Industry", sheets = list( - "OECD", "Non-OECD", + "WORLD", "OECD", "Non-OECD", "ASEAN", "Brazil", "China", "European Union", "India", "Mexico", "Russia", "South Africa", "United States" ), @@ -149,7 +149,7 @@ readIEA_ETP <- function(subtype) { file = "ETP2017_buildings_summary.xlsx", prefix = "Buildings", sheets = list( - "OECD", "NonOECD", + "WORLD", "OECD", "NonOECD", "ASEAN", "Brazil", "China", "European Union", "India", "Mexico", "Russia", "South Africa", "United States" ), @@ -278,7 +278,7 @@ readIEA_ETP <- function(subtype) { file = "ETP2017_scenario_summary.xlsx", prefix = "Summary", sheets = list( - "OECD", "NonOECD", + "WORLD", "OECD", "NonOECD", "ASEAN", "Brazil", "China", "European Union", "India", "Mexico", "Russia", "South Africa", "United States" ), @@ -452,7 +452,7 @@ readIEA_ETP <- function(subtype) { file = "ETP2017_transport_summary.xlsx", prefix = "Transport", sheets = list( - "OECD", "Non-OECD", + "WORLD", "OECD", "Non-OECD", "ASEAN", "Brazil", "China", "European Union", "India", "Mexico", "Russia", "South Africa", "United States" ), diff --git a/README.md b/README.md index 8b74075b..e73e0452 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MadRat REMIND Input Data Package -R package **mrremind**, version **0.192.9** +R package **mrremind**, version **0.192.10** [![CRAN status](https://www.r-pkg.org/badges/version/mrremind)](https://cran.r-project.org/package=mrremind) [![R build status](https://github.com/pik-piam/mrremind/workflows/check/badge.svg)](https://github.com/pik-piam/mrremind/actions) [![codecov](https://codecov.io/gh/pik-piam/mrremind/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrremind) [![r-universe](https://pik-piam.r-universe.dev/badges/mrremind)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark . +Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J (2024). _mrremind: MadRat REMIND Input Data Package_. R package version 0.192.10, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrremind: MadRat REMIND Input Data Package}, author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux and Johannes Koch}, year = {2024}, - note = {R package version 0.192.9}, + note = {R package version 0.192.10}, url = {https://github.com/pik-piam/mrremind}, } ``` diff --git a/inst/extdata/historical_mif_filter_table.csv b/inst/extdata/historical_mif_filter_table.csv deleted file mode 100644 index 557c8b1f..00000000 --- a/inst/extdata/historical_mif_filter_table.csv +++ /dev/null @@ -1,7 +0,0 @@ -scenario,model,variable,include_regions,exclude_regions -historical,IEA ETP 2DS,Production|Industry|Cement (Mt/yr),GLO, -historical,IEA ETP 2DS,Production|Industry|Steel (Mt/yr),GLO, -historical,IEA ETP B2DS,Production|Industry|Cement (Mt/yr),GLO, -historical,IEA ETP B2DS,Production|Industry|Steel (Mt/yr),GLO, -historical,IEA ETP RTS,Production|Industry|Cement (Mt/yr),GLO, -historical,IEA ETP RTS,Production|Industry|Steel (Mt/yr),GLO, diff --git a/inst/extdata/regional/regionmappingIEA_ETP.csv b/inst/extdata/regional/regionmappingIEA_ETP.csv new file mode 100755 index 00000000..7331c048 --- /dev/null +++ b/inst/extdata/regional/regionmappingIEA_ETP.csv @@ -0,0 +1,250 @@ +X;CountryCode;EEAReg;OECD +Afghanistan;AFG;rest;Non-OECD +Aland Islands;ALA;EUR;Non-OECD +Albania;ALB;rest;Non-OECD +Algeria;DZA;rest;Non-OECD +American Samoa;ASM;rest;Non-OECD +Andorra;AND;rest;Non-OECD +Angola;AGO;rest;Non-OECD +Anguilla;AIA;rest;Non-OECD +Antarctica;ATA;rest;Non-OECD +Antigua and Barbuda;ATG;rest;Non-OECD +Argentina;ARG;rest;Non-OECD +Armenia;ARM;rest;Non-OECD +Aruba;ABW;rest;Non-OECD +Australia;AUS;rest;OECD +Austria;AUT;EUR;OECD +Azerbaijan;AZE;rest;Non-OECD +Bahamas;BHS;rest;Non-OECD +Bahrain;BHR;rest;Non-OECD +Bangladesh;BGD;rest;Non-OECD +Barbados;BRB;rest;Non-OECD +Belarus;BLR;rest;Non-OECD +Belgium;BEL;EUR;OECD +Belize;BLZ;rest;Non-OECD +Benin;BEN;rest;Non-OECD +Bermuda;BMU;rest;Non-OECD +Bhutan;BTN;rest;Non-OECD +Bolivia, Plurinational State of;BOL;rest;Non-OECD +Bonaire, Sint Eustatius and Saba;BES;rest;Non-OECD +Bosnia and Herzegovina;BIH;rest;Non-OECD +Botswana;BWA;rest;Non-OECD +Bouvet Island;BVT;rest;Non-OECD +Brazil;BRA;BRA;Non-OECD +British Indian Ocean Territory;IOT;rest;Non-OECD +Brunei Darussalam;BRN;ASEAN;Non-OECD +Bulgaria;BGR;EUR;Non-OECD +Burkina Faso;BFA;rest;Non-OECD +Burundi;BDI;rest;Non-OECD +Cambodia;KHM;ASEAN;Non-OECD +Cameroon;CMR;rest;Non-OECD +Canada;CAN;rest;OECD +Cape Verde;CPV;rest;Non-OECD +Cayman Islands;CYM;rest;Non-OECD +Central African Republic;CAF;rest;Non-OECD +Chad;TCD;rest;Non-OECD +Chile;CHL;rest;OECD +China;CHN;CHN;Non-OECD +Christmas Island;CXR;rest;Non-OECD +Cocos (Keeling) Islands;CCK;rest;Non-OECD +Colombia;COL;rest;OECD +Comoros;COM;rest;Non-OECD +Congo;COG;rest;Non-OECD +Congo, the Democratic Republic of the;COD;rest;Non-OECD +Cook Islands;COK;rest;Non-OECD +Costa Rica;CRI;rest;Non-OECD +Cote d Ivoire;CIV;rest;Non-OECD +Croatia;HRV;EUR;Non-OECD +Cuba;CUB;rest;Non-OECD +Curacao;CUW;rest;Non-OECD +Cyprus;CYP;EUR;Non-OECD +Czech Republic;CZE;EUR;OECD +Denmark;DNK;EUR;OECD +Djibouti;DJI;rest;Non-OECD +Dominica;DMA;rest;Non-OECD +Dominican Republic;DOM;rest;Non-OECD +Ecuador;ECU;rest;Non-OECD +Egypt;EGY;rest;Non-OECD +El Salvador;SLV;rest;Non-OECD +Equatorial Guinea;GNQ;rest;Non-OECD +Eritrea;ERI;rest;Non-OECD +Estonia;EST;EUR;OECD +Ethiopia;ETH;rest;Non-OECD +Falkland Islands (Malvinas);FLK;rest;Non-OECD +Faroe Islands;FRO;EUR;Non-OECD +Fiji;FJI;rest;Non-OECD +Finland;FIN;EUR;OECD +France;FRA;EUR;OECD +French Guiana;GUF;rest;Non-OECD +French Polynesia;PYF;rest;Non-OECD +French Southern Territories;ATF;rest;Non-OECD +Gabon;GAB;rest;Non-OECD +Gambia;GMB;rest;Non-OECD +Georgia;GEO;rest;Non-OECD +Germany;DEU;EUR;OECD +Ghana;GHA;rest;Non-OECD +Gibraltar;GIB;EUR;Non-OECD +Greece;GRC;EUR;OECD +Greenland;GRL;rest;Non-OECD +Grenada;GRD;rest;Non-OECD +Guadeloupe;GLP;rest;Non-OECD +Guam;GUM;rest;Non-OECD +Guatemala;GTM;rest;Non-OECD +Guernsey;GGY;EUR;Non-OECD +Guinea;GIN;rest;Non-OECD +Guinea-Bissau;GNB;rest;Non-OECD +Guyana;GUY;rest;Non-OECD +Haiti;HTI;rest;Non-OECD +Heard Island and McDonald Islands;HMD;rest;Non-OECD +Holy See (Vatican City State);VAT;rest;Non-OECD +Honduras;HND;rest;Non-OECD +Hong Kong;HKG;rest;Non-OECD +Hungary;HUN;EUR;OECD +Iceland;ISL;rest;OECD +India;IND;IND;Non-OECD +Indonesia;IDN;ASEAN;Non-OECD +Iran, Islamic Republic of;IRN;rest;Non-OECD +Iraq;IRQ;rest;Non-OECD +Ireland;IRL;EUR;OECD +Isle of Man;IMN;EUR;Non-OECD +Israel;ISR;rest;OECD +Italy;ITA;EUR;OECD +Jamaica;JAM;rest;Non-OECD +Japan;JPN;rest;OECD +Jersey;JEY;EUR;Non-OECD +Jordan;JOR;rest;Non-OECD +Kazakhstan;KAZ;rest;Non-OECD +Kenya;KEN;rest;Non-OECD +Kiribati;KIR;rest;Non-OECD +Korea, Democratic People's Republic of;PRK;rest;Non-OECD +Korea, Republic of;KOR;rest;OECD +Kuwait;KWT;rest;Non-OECD +Kyrgyzstan;KGZ;rest;Non-OECD +Lao People's Democratic Republic;LAO;ASEAN;Non-OECD +Latvia;LVA;EUR;OECD +Lebanon;LBN;rest;Non-OECD +Lesotho;LSO;rest;Non-OECD +Liberia;LBR;rest;Non-OECD +Libya;LBY;rest;Non-OECD +Liechtenstein;LIE;rest;Non-OECD +Lithuania;LTU;EUR;OECD +Luxembourg;LUX;EUR;OECD +Macao;MAC;rest;Non-OECD +Macedonia, the former Yugoslav Republic of;MKD;rest;Non-OECD +Madagascar;MDG;rest;Non-OECD +Malawi;MWI;rest;Non-OECD +Malaysia;MYS;ASEAN;Non-OECD +Maldives;MDV;rest;Non-OECD +Mali;MLI;rest;Non-OECD +Malta;MLT;EUR;Non-OECD +Marshall Islands;MHL;rest;Non-OECD +Martinique;MTQ;rest;Non-OECD +Mauritania;MRT;rest;Non-OECD +Mauritius;MUS;rest;Non-OECD +Mayotte;MYT;rest;Non-OECD +Mexico;MEX;MEX;OECD +Micronesia, Federated States of;FSM;rest;Non-OECD +Moldova, Republic of;MDA;rest;Non-OECD +Monaco;MCO;rest;Non-OECD +Mongolia;MNG;rest;Non-OECD +Montenegro;MNE;rest;Non-OECD +Montserrat;MSR;rest;Non-OECD +Morocco;MAR;rest;Non-OECD +Mozambique;MOZ;rest;Non-OECD +Myanmar;MMR;ASEAN;Non-OECD +Namibia;NAM;rest;Non-OECD +Nauru;NRU;rest;Non-OECD +Nepal;NPL;rest;Non-OECD +Netherlands;NLD;EUR;OECD +New Caledonia;NCL;rest;Non-OECD +New Zealand;NZL;rest;OECD +Nicaragua;NIC;rest;Non-OECD +Niger;NER;rest;Non-OECD +Nigeria;NGA;rest;Non-OECD +Niue;NIU;rest;Non-OECD +Norfolk Island;NFK;rest;Non-OECD +Northern Mariana Islands;MNP;rest;Non-OECD +Norway;NOR;rest;OECD +Oman;OMN;rest;Non-OECD +Pakistan;PAK;rest;Non-OECD +Palau;PLW;rest;Non-OECD +Palestine, State of;PSE;rest;Non-OECD +Panama;PAN;rest;Non-OECD +Papua New Guinea;PNG;rest;Non-OECD +Paraguay;PRY;rest;Non-OECD +Peru;PER;rest;Non-OECD +Philippines;PHL;ASEAN;Non-OECD +Pitcairn;PCN;rest;Non-OECD +Poland;POL;EUR;OECD +Portugal;PRT;EUR;OECD +Puerto Rico;PRI;rest;Non-OECD +Qatar;QAT;rest;Non-OECD +Reunion;REU;rest;Non-OECD +Romania;ROU;EUR;Non-OECD +Russian Federation;RUS;RUS;Non-OECD +Rwanda;RWA;rest;Non-OECD +Saint Barthelemy;BLM;rest;Non-OECD +Saint Helena, Ascension and Tristan da Cunha;SHN;rest;Non-OECD +Saint Kitts and Nevis;KNA;rest;Non-OECD +Saint Lucia;LCA;rest;Non-OECD +Saint Martin (French part);MAF;rest;Non-OECD +Saint Pierre and Miquelon;SPM;rest;Non-OECD +Saint Vincent and the Grenadines;VCT;rest;Non-OECD +Samoa;WSM;rest;Non-OECD +San Marino;SMR;rest;Non-OECD +Sao Tome and Principe;STP;rest;Non-OECD +Saudi Arabia;SAU;rest;Non-OECD +Senegal;SEN;rest;Non-OECD +Serbia;SRB;rest;Non-OECD +Seychelles;SYC;rest;Non-OECD +Sierra Leone;SLE;rest;Non-OECD +Singapore;SGP;ASEAN;Non-OECD +Sint Maarten (Dutch part);SXM;rest;Non-OECD +Slovakia;SVK;EUR;OECD +Slovenia;SVN;EUR;OECD +Solomon Islands;SLB;rest;Non-OECD +Somalia;SOM;rest;Non-OECD +South Africa;ZAF;ZAF;Non-OECD +South Georgia and the South Sandwich Islands;SGS;rest;Non-OECD +South Sudan;SSD;rest;Non-OECD +Spain;ESP;EUR;OECD +Sri Lanka;LKA;rest;Non-OECD +Sudan;SDN;rest;Non-OECD +Suriname;SUR;rest;Non-OECD +Svalbard and Jan Mayen;SJM;rest;Non-OECD +Swaziland;SWZ;rest;Non-OECD +Sweden;SWE;EUR;OECD +Switzerland;CHE;rest;OECD +Syrian Arab Republic;SYR;rest;Non-OECD +Taiwan, Province of China;TWN;rest;Non-OECD +Tajikistan;TJK;rest;Non-OECD +Tanzania, United Republic of;TZA;rest;Non-OECD +Thailand;THA;ASEAN;Non-OECD +Timor-Leste;TLS;rest;Non-OECD +Togo;TGO;rest;Non-OECD +Tokelau;TKL;rest;Non-OECD +Tonga;TON;rest;Non-OECD +Trinidad and Tobago;TTO;rest;Non-OECD +Tunisia;TUN;rest;Non-OECD +Turkey;TUR;rest;OECD +Turkmenistan;TKM;rest;Non-OECD +Turks and Caicos Islands;TCA;rest;Non-OECD +Tuvalu;TUV;rest;Non-OECD +Uganda;UGA;rest;Non-OECD +Ukraine;UKR;rest;Non-OECD +United Arab Emirates;ARE;rest;Non-OECD +United Kingdom;GBR;EUR;OECD +United States;USA;USA;OECD +United States Minor Outlying Islands;UMI;rest;Non-OECD +Uruguay;URY;rest;Non-OECD +Uzbekistan;UZB;rest;Non-OECD +Vanuatu;VUT;rest;Non-OECD +Venezuela, Bolivarian Republic of;VEN;rest;Non-OECD +Viet Nam;VNM;ASEAN;Non-OECD +Virgin Islands, British;VGB;rest;Non-OECD +Virgin Islands, U.S.;VIR;rest;Non-OECD +Wallis and Futuna;WLF;rest;Non-OECD +Western Sahara;ESH;rest;Non-OECD +Yemen;YEM;rest;Non-OECD +Zambia;ZMB;rest;Non-OECD +Zimbabwe;ZWE;rest;Non-OECD diff --git a/man/filter_historical_mif.Rd b/man/filter_historical_mif.Rd deleted file mode 100644 index c2063716..00000000 --- a/man/filter_historical_mif.Rd +++ /dev/null @@ -1,30 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/filter_historical_mif.R -\name{filter_historical_mif} -\alias{filter_historical_mif} -\title{Filter improperly aggregated regional data from historical.mif} -\usage{ -filter_historical_mif(path = NULL, filter_table = NULL) -} -\arguments{ -\item{path}{Path to \code{historical.mif} (or any mif for that matter), defaults -to \code{historical.mif} in the currently configured -\code{getConfig('outputfolder')}.} - -\item{filter_table}{Data frame with columns \code{scenario}, \code{model}, \code{variable}, -\code{include_regions}, and \code{exclude_regions}. Defaults to the built-in -\code{./inst/extdata/historical_mif_filter_table.csv} of the \code{mrremind} package.} -} -\description{ -Load a \code{historical.mif} file, remove designated data, write back to file. -} -\details{ -For all combinations of scenario, model, and variable (and all years), either -all regions listed in \code{exclude_regions} in the \code{filter_table} are removed, or -all regions \emph{except} those listed in \code{include_regions} in the \code{filter_table} -are removed. -Defining both \code{include_regions} and \code{exclude_regions} on the same row of -\code{filter_table} will throw an error. -Scenarios, models, and variables are matched precisely, not partially or via -regular expressions. -}