Skip to content

Commit

Permalink
adjust replace_NAs parameter in unit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Sep 3, 2024
1 parent a465f9a commit 775cee4
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion R/UNIDO.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ convertUNIDO <- function(x, subtype = 'INDSTAT2')
GDPuc::convertGDP(
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
) %>%
return()
}
Expand Down
4 changes: 2 additions & 2 deletions R/calcBP.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ calcBP <- function() {
gdp = x[, , "Price|Primary Energy|Oil (US$2023/GJ)"],
unit_in = "constant 2022 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

getNames(poil) <- gsub("\\$2023", "\\$2017", getNames(poil))
Expand All @@ -156,7 +156,7 @@ calcBP <- function() {
gdp = x[, , c("Price|Primary Energy|Gas (US$/GJ)", "Price|Primary Energy|Coal (US$/GJ)")],
unit_in = "current US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

getNames(pcoalgas) <- gsub("\\$", "\\$2017", getNames(pcoalgas))
Expand Down
2 changes: 1 addition & 1 deletion R/calcBiomassPrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ calcBiomassPrices <- function() {
gdp = x,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

return(list(x = x,
Expand Down
2 changes: 1 addition & 1 deletion R/calcCO2Prices.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ calcCO2Prices <- function() {
gdp = x,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

# read data used for weight
Expand Down
2 changes: 1 addition & 1 deletion R/calcCostsTradePeFinancial.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ calcCostsTradePeFinancial <- function() {
gdp = data,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

w <- calcOutput("GDP", aggregate = FALSE)[, 2005, "gdp_SSP2"]
Expand Down
2 changes: 1 addition & 1 deletion R/calcCostsWeathering.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ calcCostsWeathering <- function() {
gdp = costs,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

weight <- costs # get the same dimensions of the data
Expand Down
2 changes: 1 addition & 1 deletion R/calcDiffInvestCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ calcDiffInvestCosts <- function(subtype) {
gdp = x_new,
unit_in = "constant 2015 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

return(list(
Expand Down
4 changes: 2 additions & 2 deletions R/calcEU_ReferenceScenario.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ calcEU_ReferenceScenario <- function() {
gdp = euRef2016[, , "Price|Secondary Energy|Electricity (EUR2013/GJ)"],
unit_in = "constant 2013 €",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

getNames(tmp) <- "Price|Secondary Energy|Electricity (US$2017/GJ)"
Expand All @@ -23,7 +23,7 @@ calcEU_ReferenceScenario <- function() {
gdp = euRef2020[, , "Price|Secondary Energy|Electricity (EUR2015/GJ)"],
unit_in = "constant 2015 €",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

getNames(tmp) <- "Price|Secondary Energy|Electricity (US$2017/GJ)"
Expand Down
2 changes: 1 addition & 1 deletion R/calcEconometricEmiParameter.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ calcEconometricEmiParameter <- function() {
gdp = p4,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

# combine all parameters
Expand Down
2 changes: 1 addition & 1 deletion R/calcINNOPATHS.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ calcINNOPATHS <- function() {
gdp = tmp,
unit_in = "constant 2015 €",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

x <- mbind(x, tmp)
Expand Down
2 changes: 1 addition & 1 deletion R/calcIndustry_EEK.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ calcIndustry_EEK <- function(kap) {
dplyr::rename("value" = "EEK") %>%
GDPuc::convertGDP(unit_in = "constant 2012 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")) %>%
replace_NAs = "with_USA") %>%
dplyr::mutate(value = .data$value * 1e-3) %>%
dplyr::rename("EEK" = "value")

Expand Down
2 changes: 1 addition & 1 deletion R/calcJRC_IDEES.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ calcJRC_IDEES <- function(subtype) {
gdp = tmp,
unit_in = "constant 2010 €",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)
x <- mbind(x, tmp)
}
Expand Down
2 changes: 1 addition & 1 deletion R/calcTaxConvergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ calcTaxConvergence <- function() {
gdp = taxConvergence,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

return(list(
Expand Down
2 changes: 1 addition & 1 deletion R/calcTaxLimits.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ calcTaxLimits <- function(subtype) {
gdp = output,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

# Return tax convergence levels aggregated to selected REMIND regions
Expand Down
2 changes: 1 addition & 1 deletion R/calcTaxXport.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ calcTaxXport <- function() {
gdp = x,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

x <- time_interpolate(x, c(seq(2010, 2150, 5)),
Expand Down
2 changes: 1 addition & 1 deletion R/convertGEA2012.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ convertGEA2012 <- function(x, subtype) {
gdp = out[, , c("xi1", "xi2")],
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)

out <- mbind(tmp, out[, , c("xi1", "xi2"), invert = TRUE])
Expand Down
2 changes: 1 addition & 1 deletion R/convertIIASA_subs_taxes.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ convertIIASA_subs_taxes <- function(x, subtype) {
gdp = x,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
replace_NAs = c("linear", "with_USA")
replace_NAs = "with_USA"
)
}

Expand Down

0 comments on commit 775cee4

Please sign in to comment.