Skip to content

Commit

Permalink
import function time_interpolate
Browse files Browse the repository at this point in the history
  • Loading branch information
ahagen-pik committed Dec 12, 2024
1 parent 20ecc4f commit 6571447
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/toolLoadmrdriversData.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ toolLoadmrdriversData <- function(SSPscen, helpers) {
GDPMERmag <- calcOutput("GDP", aggregate = TRUE, regionmapping = "regionmapping_21_EU11.csv",
unit = mrdrivers::toolGetUnitDollar())
unitGDP <- gsub(" unit: ", "", getComment(GDPMERmag)[2])
GDPMERmag <- GDPMERmag[, , paste0("gdp_", SSPscen)] |> magclass::time_interpolate(years)
GDPMERmag <- GDPMERmag[, , paste0("gdp_", SSPscen)] |> time_interpolate(years)
GDPMER <- magpie2dt(GDPMERmag, yearcol = "period", regioncol = "region")[, variable := "GDP|MER"][, unit := unitGDP]

GDPpcMERmag <- calcOutput("GDPpc", aggregate = TRUE, regionmapping = "regionmapping_21_EU11.csv",
unit = mrdrivers::toolGetUnitDollar())
unitGDP <- gsub(" unit: ", "", getComment(GDPpcMERmag)[2])
GDPpcMERmag <- GDPpcMERmag[, , paste0("gdppc_", SSPscen)] |> magclass::time_interpolate(years)
GDPpcMERmag <- GDPpcMERmag[, , paste0("gdppc_", SSPscen)] |> time_interpolate(years)
GDPpcMER <- magpie2dt(GDPpcMERmag, yearcol = "period", regioncol = "region")[, variable := "GDPpc|MER"][, unit := unitGDP]

GDPpppMag <- calcOutput("GDP", aggregate = TRUE, regionmapping = "regionmapping_21_EU11.csv")
unitGDP <- gsub(" unit: ", "", getComment(GDPpppMag)[2])
GDPpppMag <- GDPpppMag[, , paste0("gdp_", SSPscen)] |> magclass::time_interpolate(years)
GDPpppMag <- GDPpppMag[, , paste0("gdp_", SSPscen)] |> time_interpolate(years)
GDPppp <- magpie2dt(GDPpppMag, yearcol = "period", regioncol = "region")[, variable := "GDP|PPP"][, unit := unitGDP]

GDPpcPPPmag <- calcOutput("GDPpc", aggregate = TRUE, regionmapping = "regionmapping_21_EU11.csv")
unitGDP <- gsub(" unit: ", "", getComment(GDPpcPPPmag)[2])
GDPpcPPPmag <- GDPpcPPPmag[, , paste0("gdppc_", SSPscen)] |> magclass::time_interpolate(years)
GDPpcPPPmag <- GDPpcPPPmag[, , paste0("gdppc_", SSPscen)] |> time_interpolate(years)
GDPpcPPP <- magpie2dt(GDPpcPPPmag, yearcol = "period", regioncol = "region")[, variable := "GDPpc|PPP"][, unit := unitGDP]

POPmag <- calcOutput("Population", aggregate = TRUE,
regionmapping = "regionmapping_21_EU11.csv")[, , paste0("pop_", SSPscen)] |> magclass::time_interpolate(years)
regionmapping = "regionmapping_21_EU11.csv")[, , paste0("pop_", SSPscen)] |> time_interpolate(years)
POP <- magpie2dt(POPmag, yearcol = "period", regioncol = "region")[, variable := "Population"][, unit := "million"]

return(
Expand Down

0 comments on commit 6571447

Please sign in to comment.