Title: | The REMIND R package (2nd generation) |
---|---|
Description: | Contains the REMIND-specific routines for data and model output manipulation. |
Authors: | Renato Rodrigues [aut, cre], Lavinia Baumstark [aut], Falk Benke [aut], Jan Philipp Dietrich [aut], Alois Dirnaichner [aut], Jakob Duerrwaechter [aut], Pascal Führlich [aut], Anastasis Giannousakis [aut], Robin Hasse [aut], Jérome Hilaire [aut], David Klein [aut], Johannes Koch [aut], Katarzyna Kowalczyk [aut], Antoine Levesque [aut], Aman Malik [aut], Anne Merfort [aut], Leon Merfort [aut], Simón Morena-Leiva [aut], Michaja Pehl [aut], Robert Pietzcker [aut], Sebastian Rauner [aut], Oliver Richters [aut], Marianna Rottoli [aut], Christof Schötz [aut], Felix Schreyer [aut], Kais Siala [aut], Björn Sörgel [aut], Mike Spahr [aut], Jessica Strefler [aut], Philipp Verpoort [aut], Pascal Weigmann [aut], Tonn Rüter [aut] |
Maintainer: | Renato Rodrigues <[email protected]> |
License: | LGPL-3 |
Version: | 1.160.2 |
Built: | 2024-11-20 08:30:34 UTC |
Source: | https://github.com/pik-piam/remind2 |
Contains the REMIND-specific routines for data and model output manipulation.
Maintainer: Renato Rodrigues [email protected]
Authors:
Lavinia Baumstark
Falk Benke
Jan Philipp Dietrich
Alois Dirnaichner
Jakob Duerrwaechter
Pascal Führlich
Anastasis Giannousakis
Robin Hasse
Jérome Hilaire
David Klein
Johannes Koch
Katarzyna Kowalczyk
Antoine Levesque
Aman Malik
Anne Merfort
Leon Merfort
Simón Morena-Leiva
Michaja Pehl
Robert Pietzcker
Sebastian Rauner
Oliver Richters
Marianna Rottoli
Christof Schötz
Felix Schreyer
Kais Siala
Björn Sörgel
Mike Spahr
Jessica Strefler
Philipp Verpoort
Pascal Weigmann
Tonn Rüter [email protected]
Useful links:
Calculate marginals on the REMIND CES function and combine them to prices.
calc_CES_marginals(gdxName, id = "file")
calc_CES_marginals(gdxName, id = "file")
gdxName |
Vector of paths to |
id |
If several |
Marginals are calculated analytically
and prices by recursively applying the chain rule
A data frame
with columns pf
(production factor), t
, regi
,
marginal
, price
, and file
(path to originating .gdx
file).
Sum up values in data
for all sets of regions in regionSubsetList
.
calc_regionSubset_sums(data, regionSubsetList)
calc_regionSubset_sums(data, regionSubsetList)
data |
A |
regionSubsetList |
A list of region subsets to calculate of the form
|
A MAgPIE
object.
Michaja Pehl
calc_regionSubset_sums(population_magpie, list(xAM = c('LAM', 'NAM')))
calc_regionSubset_sums(population_magpie, list(xAM = c('LAM', 'NAM')))
Calculate net trade in a commodity from a GDX file and store it into a magpie object.
calcNetTrade(gdx, variable)
calcNetTrade(gdx, variable)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
variable |
one of the traded commodities in REMIND: good, pecoal, pegas, peoil, pebiolc, peur, perm |
Trade data as MAgPIE object
Niklas Roming
## Not run: coal <- calcNetTrade(gdx, "pecoal") gas <- calcNetTrade(gdx, "pegas") ## End(Not run)
## Not run: coal <- calcNetTrade(gdx, "pecoal") gas <- calcNetTrade(gdx, "pegas") ## End(Not run)
Calculate monetary value of trade in primary energy carriers in a GDX file and return as a MagPIE object.
calcNetTradeValue(gdx, variable)
calcNetTradeValue(gdx, variable)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
variable |
one of the primary energy tyes in REMIND that ar: pecoal, pegas, peoil, pebiolc, peur |
Value (in US$2005) of trade
Niklas Roming
## Not run: coal <- calcNetTradeValue(gdx, "pecoal") gas <- calcNetTradeValue(gdx, "pegas") ## End(Not run)
## Not run: coal <- calcNetTradeValue(gdx, "pecoal") gas <- calcNetTradeValue(gdx, "pegas") ## End(Not run)
Read PVP data of a certain commodity from a GDX file into a magpie object and normalize it with the 2005 goods price.
calcPrice(gdx, level = "glo", enty = "good", type = "nominal")
calcPrice(gdx, level = "glo", enty = "good", type = "nominal")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
level |
spartiel resolution "glo" = global or "reg" = regional |
enty |
one of the traded commodities in REMIND: good, pecoal, pegas, peoil, pebiolc, peur, perm |
type |
calculate present values (PVP(t)/PVP_Good(2005)) or nominal values(PVP(t)/PVP_Good(t)) |
normalized price data as MAgPIE object
Niklas Roming
## Not run: coal <- calcPrice(gdx, enty = "pecoal") gas <- calcPrice(gdx, enty = "pegas") ## End(Not run)
## Not run: coal <- calcPrice(gdx, enty = "pecoal") gas <- calcPrice(gdx, enty = "pegas") ## End(Not run)
Render checkVsCalibData
checkVsCalibData( gdx, outputDir = getwd(), outputFile = "Check_vs_CalibData.pdf" )
checkVsCalibData( gdx, outputDir = getwd(), outputFile = "Check_vs_CalibData.pdf" )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
outputDir |
|
outputFile |
|
The value returned by rmarkdown::render()
.
Falk Benke
## Not run: # Simple use. Creates PDF: checkVsCalibData( gdx = "path/to/data.gdx", outputDir = "path/to/output/directory", outputFile = "Check_vs_CalibData_Example.pdf" ) ## End(Not run)
## Not run: # Simple use. Creates PDF: checkVsCalibData( gdx = "path/to/data.gdx", outputDir = "path/to/output/directory", outputFile = "Check_vs_CalibData_Example.pdf" ) ## End(Not run)
take scenario-config*.csv files and produce colorful xlsx file with values from main.gms in first row, identical values in this column in turquoise, and unknown column names in red
colorScenConf(fileList = "", remindPath = ".", expanddata = FALSE)
colorScenConf(fileList = "", remindPath = ".", expanddata = FALSE)
fileList |
vector containing csv file paths |
remindPath |
path to REMIND directory containing the main.gms |
expanddata |
fill all the data based on copyConfigFrom and main.gms |
nothing. For each file in fileList a _colorful.xlsx file is written.
Oliver Richters
## Not run: colorScenConf(fileList = c("scenario_config.csv"), remindPath = ".") ## End(Not run)
## Not run: colorScenConf(fileList = c("scenario_config.csv"), remindPath = ".") ## End(Not run)
Render compareCalibrationTargets
compareCalibrationTargets( gdxPaths, outputDir = getwd(), outputFile = "compareCalibrationTargets.html" )
compareCalibrationTargets( gdxPaths, outputDir = getwd(), outputFile = "compareCalibrationTargets.html" )
gdxPaths |
|
outputDir |
The directory where the output document and intermediary files are created. |
outputFile |
File name (without extension) of the output document to be created. |
The value returned by rmarkdown::render()
.
Falk Benke
## Not run: # Simple use. checkVsCalibData( gdxPaths = c("path/to/fulldata.gdx", "another path/to/fulldata.gdx"), outputDir = "path/to/output/directory", outputFile = "myComparison.html" ) ## End(Not run)
## Not run: # Simple use. checkVsCalibData( gdxPaths = c("path/to/fulldata.gdx", "another path/to/fulldata.gdx"), outputDir = "path/to/output/directory", outputFile = "myComparison.html" ) ## End(Not run)
A deprecated function. Please refer to piamPlotComparison::compareScenarios
compareScenarios2(...)
compareScenarios2(...)
... |
parameters to be passed on to piamPlotComparison::compareScenarios |
The value returned by rmarkdown::render()
.
take two REMIND scenario-config*.csv files and print the difference, comparing it to a default.cfg
compareScenConf( fileList = NULL, remindPath = "/p/projects/rd3mod/github/repos/remindmodel/remind/develop", row.names = 1, renamedCols = NULL, renamedRows = NULL, printit = TRUE, expanddata = TRUE )
compareScenConf( fileList = NULL, remindPath = "/p/projects/rd3mod/github/repos/remindmodel/remind/develop", row.names = 1, renamedCols = NULL, renamedRows = NULL, printit = TRUE, expanddata = TRUE )
fileList |
vector containing one csv file paths or two paths as c(oldfile, newfile) If one, searches same filename in defaultPath. If NULL, user can select |
remindPath |
path to REMIND directory containing main.gms |
row.names |
column in csv used for row.names. Use NULL for mapping files |
renamedCols |
vector with old and new column names such as c("old1" = "new1", "old2" = "new2")) |
renamedRows |
vector with old and new row names such as c("old3" = "new3", "old3" = "new4", "old5" = "new5")) the "old" name can also remain in the new file, if you generated a variant |
printit |
boolean switch (default: TRUE) whether function prints its output |
expanddata |
fill empty cells with default values |
list with $allwarnings and $out
Oliver Richters
## Not run: compareScenConf(fileList = c("scenario_config_old.csv", "scenario_config_new.csv"), renamedCols = c("old1" = "new1", "old2" = "new2"), renamedRows = c("old3" = "new3", "old4" = "new4")) ## End(Not run)
## Not run: compareScenConf(fileList = c("scenario_config_old.csv", "scenario_config_new.csv"), renamedCols = c("old1" = "new1", "old2" = "new2"), renamedRows = c("old3" = "new3", "old4" = "new4")) ## End(Not run)
Read in all information from GDX file, calculate the LCOE for pe2se technologies and create the LCOE .csv reporting
convGDX2CSV_LCOE( gdx, file = NULL, scen = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
convGDX2CSV_LCOE( gdx, file = NULL, scen = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
file |
name of the csv file which will be written |
scen |
scenario name that is used in the *.mif reporting |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2030,2050) |
Felix Schreyer
## Not run: convGDX2CSV_LCOE(gdx,file="REMIND_LCOE_reporting.csv",scenario="default")
## Not run: convGDX2CSV_LCOE(gdx,file="REMIND_LCOE_reporting.csv",scenario="default")
Read in all information from GDX file and create the *.mif reporting
convGDX2MIF( gdx, gdx_ref = NULL, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_refpolicycost = gdx_ref, testthat = FALSE )
convGDX2MIF( gdx, gdx_ref = NULL, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_refpolicycost = gdx_ref, testthat = FALSE )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
gdx_ref |
reference-gdx for < cm_startyear, used for fixing the prices to this scenario |
file |
name of the mif file which will be written, if no name is provided a magpie object containing all the reporting information is returned |
scenario |
scenario name that is used in the *.mif reporting |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
gdx_refpolicycost |
reference-gdx for policy costs, a GDX as created by readGDX, or the file name of a gdx |
testthat |
boolean whether called by tests, turns some messages into warnings |
Lavinia Baumstark
## Not run: convGDX2MIF(gdx, gdx_refpolicycost, file = "REMIND_generic_default.csv", scenario = "default") ## End(Not run)
## Not run: convGDX2MIF(gdx, gdx_refpolicycost, file = "REMIND_generic_default.csv", scenario = "default") ## End(Not run)
Read in all information from GDX file, calculate the LCOE for pe2se technologies and create the LCOE .mif reporting
convGDX2MIF_LCOE( gdx, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
convGDX2MIF_LCOE( gdx, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
file |
name of the mif file which will be written, if no name is provided a magpie object containing all the reporting information is returned |
scenario |
scenario name that is used in the *.mif reporting |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2030,2050) |
Lavinia Baumstark
## Not run: convGDX2MIF_LCOE(gdx, file = "REMIND_generic_LCOE.csv", scenario = "default") ## End(Not run)
## Not run: convGDX2MIF_LCOE(gdx, file = "REMIND_generic_LCOE.csv", scenario = "default") ## End(Not run)
Read in information from GDX file and create the *.mif reporting using only reporting functions that calculate the variables that are relevant for the REMIND-MAgPIE coupling
convGDX2MIF_REMIND2MAgPIE( gdx, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
convGDX2MIF_REMIND2MAgPIE( gdx, file = NULL, scenario = "default", t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
file |
name of the mif file which will be written. If no name is provided a magpie object containing all the reporting information is returned |
scenario |
scenario name that is used in the *.mif reporting |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
David Klein
## Not run: convGDX2MIF_REMIND2MAgPIE(gdx,file="REMIND_generic_default.csv",scenario="default")
## Not run: convGDX2MIF_REMIND2MAgPIE(gdx,file="REMIND_generic_default.csv",scenario="default")
Creates a hierarchical list from mif data using variablesAsList
and writes it as an HTML document that displays the hierarchy via the
<details>
HTML5-tag.
createVarListHtml( x, outFileName, title = "List of Variables", htmlBefore = "", usePlus = FALSE, details = NULL )
createVarListHtml( x, outFileName, title = "List of Variables", htmlBefore = "", usePlus = FALSE, details = NULL )
x |
A character vector of variable names, a quitte object, or a character vectors of paths to mif files. |
outFileName |
A single string. The path of the output file, preferably
ending in |
title |
The title displayed at the top of the created HTML. |
htmlBefore |
|
usePlus |
|
details |
|
## Not run: loadModeltest() createVarListHtml(data, "variables.html") detailsAR6 <- readr::read_delim( paste0( "https://raw.githubusercontent.com/pik-piam/", "piamInterfaces/master/inst/mappings/mapping_AR6.csv"), delim = ";", col_select = c(r21m42, Definition) ) %>% rename(name = r21m42) createVarListHtml( data, "variablesWithDescription.html", title = "Reported REMIND Variables with AR6 Description", usePlus = TRUE, details = detailsAR6) ## End(Not run)
## Not run: loadModeltest() createVarListHtml(data, "variables.html") detailsAR6 <- readr::read_delim( paste0( "https://raw.githubusercontent.com/pik-piam/", "piamInterfaces/master/inst/mappings/mapping_AR6.csv"), delim = ";", col_select = c(r21m42, Definition) ) %>% rename(name = r21m42) createVarListHtml( data, "variablesWithDescription.html", title = "Reported REMIND Variables with AR6 Description", usePlus = TRUE, details = detailsAR6) ## End(Not run)
Slightly modified version of the dimSums
function of the magclass package.
It will expand magclass objects of length 0 by adding an element in the dimension
over which dimSumsSpecial
is applied and set all values to 0 and it
will name the spatial dimension "GLO" if summation over this dimension happens.
dimSums(x, dim = 3, na.rm = FALSE)
dimSums(x, dim = 3, na.rm = FALSE)
x |
A MAgPIE-object |
dim |
The dimensions(s) to sum over. A vector of dimension codes or dimension names.
See |
na.rm |
logical. Should missing values (including NaN) be omitted from the calculations? |
A MAgPIE object with values summed over the specified dimensions
Jan Philipp Dietrich
allows to copy a GDX file from place A to place B using the name with the *.gz ending, regardless if it's zipped or not
gdx.copy(from, to)
gdx.copy(from, to)
from |
path to a zipped or unzipped GDX |
to |
where the unzipped GDX will go and what name it will have |
Anastasis Giannousakis
## Not run: gdx.copy(path_gdx, "config/input.gdx", overwrite=TRUE)
## Not run: gdx.copy(path_gdx, "config/input.gdx", overwrite=TRUE)
Computes total efficiency
from
pm_cesdata
.
get_total_efficiencies(gdxName)
get_total_efficiencies(gdxName)
gdxName |
Path to |
A data.frame
with columns t
, regi
, pf
(production factor) and the alpha
value.
Michaja Pehl
getMifScenPath
: get path to the scenarios' reporting mifs.
getMifHistPath
: get path to the scenarios' historical.mif.
getCfgScenPath
: get path to the scenarios' config.Rdata.
getCfgDefaultPath
: get path to REMIND's default.cfg.
getMifScenPath(outputDirs, mustWork = FALSE) getMifHistPath(outputDirs, mustWork = FALSE) getCfgScenPath(outputDirs, mustWork = FALSE) getCfgDefaultPath(remindDir = ".", mustWork = FALSE)
getMifScenPath(outputDirs, mustWork = FALSE) getMifHistPath(outputDirs, mustWork = FALSE) getCfgScenPath(outputDirs, mustWork = FALSE) getCfgDefaultPath(remindDir = ".", mustWork = FALSE)
outputDirs |
A character vector of paths to output folders of REMIND runs. |
mustWork |
|
remindDir |
A single string. The path to the remind directory. |
Copy fulldata.gdx and mif files from a suite of runs into one folder. This function creates the folder "./data/" in your working directory if such folder does not exist. It will furthermore create a subfolder with the experiment name where the gdx and mif-files will be copied to. Care: If this subfolder is already existing, old files in this subfolder will be overwritten!
getRunsMIFGDX(output.folder, experiment)
getRunsMIFGDX(output.folder, experiment)
output.folder |
a vector with the paths to REMIND output folders of the desired runs |
experiment |
name of this experiment (suite of runs) |
no return, function creates data folder and copies output files into it
Felix Schreyer
## Not run: copyMIFGDX(c("Z:/Modeling/REMIND/output/BAU_2019-12-03_14.30.56/", "Z:/Modeling/REMIND/output/NDC_2019-12-03_15.20.53/"), experiment = "NewFeature_03_12_19") ## End(Not run)
## Not run: copyMIFGDX(c("Z:/Modeling/REMIND/output/BAU_2019-12-03_14.30.56/", "Z:/Modeling/REMIND/output/NDC_2019-12-03_15.20.53/"), experiment = "NewFeature_03_12_19") ## End(Not run)
Load data from mif files into R-objects as used in compareScenarios().
loadCs2Data( mifScen, mifHist, cfgScen = NULL, cfgDefault = NULL, envir = globalenv() )
loadCs2Data( mifScen, mifHist, cfgScen = NULL, cfgDefault = NULL, envir = globalenv() )
mifScen |
|
mifHist |
|
cfgScen , cfgDefault
|
See section "YAML Parameters" in compareScenarios(). |
envir |
|
## Not run: loadCs2Data( c("path/to/Base.mif", "path/to/NDC.mif"), "path/to/historical.mif") ## End(Not run)
## Not run: loadCs2Data( c("path/to/Base.mif", "path/to/NDC.mif"), "path/to/historical.mif") ## End(Not run)
The newest model tests are collected from the cluster and copied into a temporary folder (by default). Then the compareScenarios() data loading procedure is used to load this data into the users environment.
loadModeltest( envir = globalenv(), namePattern = "^SSP2-.*-AMT$", folder = tempdir() )
loadModeltest( envir = globalenv(), namePattern = "^SSP2-.*-AMT$", folder = tempdir() )
envir |
|
namePattern |
|
folder |
|
## Not run: loadModeltest() ssp1 <- new.env() ssp2eu <- new.env() loadModeltest(ssp1, "^SSP1-AMT-") loadModeltest(ssp2eu, "^SSP2-.*-AMT$") ssp1$data ssp2eu$data ## End(Not run)
## Not run: loadModeltest() ssp1 <- new.env() ssp2eu <- new.env() loadModeltest(ssp1, "^SSP1-AMT-") loadModeltest(ssp2eu, "^SSP2-.*-AMT$") ssp1$data ssp2eu$data ## End(Not run)
This function transforms investment variables to the normal reporting convention.
modifyInvestmentVariables(x, ref = NULL, startYear = NULL)
modifyInvestmentVariables(x, ref = NULL, startYear = NULL)
x |
a magclass object to be manipulated, must have timesteps in 'ttot' |
ref |
an optional magclass object to be used for fixing values before 'startYear' |
startYear |
years before will be overwritten with values from 'ref' |
Years represented by investment variables in the energy system ('vm_deltaCap', 'vm_costInvTeDir' and 'vm_costInvTeAdj') are different from the normal reporting convention. In the current REMIND version, vm_deltacap(t) represents the average of the years t-4..t, while in the general reporting convention it represents the average of t-2.5..t+2.5 (for 5 year time steps).
See also: https://github.com/remindmodel/remind/pull/1238.
Falk Benke
Create plots visualizing nash convergence of a given REMIND run
nashAnalysis( gdx = "fulldata.gdx", outputDir = getwd(), outputFile = "Nash Analysis.html" )
nashAnalysis( gdx = "fulldata.gdx", outputDir = getwd(), outputFile = "Nash Analysis.html" )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
outputDir |
|
outputFile |
|
The value returned by rmarkdown::render()
.
Falk Benke
Read in all information from LCOE mif file and create the LCOE_plots.pdf
plotLCOE( LCOEfile, gdx, y = c(2015, 2020, 2030, 2040, 2050, 2060), reg = "all_regi", fileName = "LCOE_plots.pdf" )
plotLCOE( LCOEfile, gdx, y = c(2015, 2020, 2030, 2040, 2050, 2060), reg = "all_regi", fileName = "LCOE_plots.pdf" )
LCOEfile |
a path to the LCOE reporting csv file of the scenario to be plotted |
gdx |
gdx file of run |
y |
time span for the data in line plots, default: y=c(2015, 2020,2030,2040,2050,2060) |
reg |
region(s) in focus, reg ="all_regi" shows all regions if the mifs contain different regions |
fileName |
name of the pdf, default = "LCOE_plots.pdf" |
Felix Schreyer
Creates a REMIND convergence overview
plotNashConvergence(gdx)
plotNashConvergence(gdx)
gdx |
GDX file |
Renato Rodrigues, Falk Benke
## Not run: plotNashConvergence(gdx="fulldata.gdx") ## End(Not run)
## Not run: plotNashConvergence(gdx="fulldata.gdx") ## End(Not run)
This function reads one entry of a reporting file (a file in the model intercomparison file format *.mif) into a MAgPIE object. This function can be used by readAll() to read in the data for more than one output folder
read.reportEntry(outputdir, entry, type = NULL)
read.reportEntry(outputdir, entry, type = NULL)
outputdir |
output folder which contains the reporting |
entry |
entry of the reporting that you want to read in |
type |
type of the reporting that you want to read in |
Lavinia Baumstark, David Klein
## Not run: read.reportEntry("output/SSP2-ref", entry = "Emi|Kyoto Gases (Mt CO2eq/yr)") remind2:::readAll(outputdirs, read.reportEntry, entry = "Emi|Kyoto Gases (Mt CO2eq/yr)", asList = FALSE) ## End(Not run)
## Not run: read.reportEntry("output/SSP2-ref", entry = "Emi|Kyoto Gases (Mt CO2eq/yr)") remind2:::readAll(outputdirs, read.reportEntry, entry = "Emi|Kyoto Gases (Mt CO2eq/yr)", asList = FALSE) ## End(Not run)
(This function was copied from magpie::read_all to remove the magpie dependency.) Function to read in input from multiple gdx files.
readAll(pathToGdx, func, asList = TRUE, ...)
readAll(pathToGdx, func, asList = TRUE, ...)
pathToGdx |
A vector or list. Can contain either the filenames of gdx files or GDX lists as created by readGDX. If it is named, the names will also be used for the output) |
func |
The output function that should be executed on the gdx files. E.g. emissions |
asList |
If TRUE, the output will be a list of length(gdx). If FALSE, read_all tries to store everything in one magpie object. |
... |
Additional arguments passed to func. |
A list of magpie objects (as.list=TRUE) or one magpie object (as.list=FALSE) with the output returned by func for all the gdx files
Markus Bonsch
## Not run: gdxPaths <- c(baseline = "fulldata1.gdx", policy = "fulldata2.gdx") croparea <- read_all(gdxPaths, func = croparea, level = "glo", crop_aggr = TRUE, asList = TRUE) ## End(Not run)
## Not run: gdxPaths <- c(baseline = "fulldata1.gdx", policy = "fulldata2.gdx") croparea <- read_all(gdxPaths, func = croparea, level = "glo", crop_aggr = TRUE, asList = TRUE) ## End(Not run)
read in all valid MIF reporting files in a folder and return data as a quitte-object. If no mif exists it searches for CSV
readAllReportingMIFinFolder(dir, RData = FALSE, verbose = TRUE)
readAllReportingMIFinFolder(dir, RData = FALSE, verbose = TRUE)
dir |
character. Directory containing the MIF files. |
RData |
logical. If true data is saved in Rdata format to save read-in time. |
verbose |
logical. If true (un)helpful information will be display. |
quitte object
Anselm Schultes, Jerome Hilaire, Lavinia Baumstark, David Klein
## Not run: qd <- readAllReportingMIFinFolder('/my/magic/remind/run/') ## End(Not run)
## Not run: qd <- readAllReportingMIFinFolder('/my/magic/remind/run/') ## End(Not run)
Read Consumption data from a GDX file into a magpie object.
readConsumption(gdx, field = "l")
readConsumption(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up' |
Jonas Hoersch
## Not run: cons <- readConsumption(gdx)
## Not run: cons <- readConsumption(gdx)
Read Current Account data from a GDX file into a magpie object.
readCurrentAccount(gdx)
readCurrentAccount(gdx)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
Jonas Hoersch
## Not run: readCurrentAccount(gdx)
## Not run: readCurrentAccount(gdx)
Read emission data from a GDX file into a magpie object. summs automatically over all kinds of enty and vm_emiengregi and vm_emiengregi
readEmissions(gdx, emiengregi, eminegregi)
readEmissions(gdx, emiengregi, eminegregi)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
emiengregi |
enty that is read in from vm_emiengregi, vector is possible e.g. c("co2","n2o"). If you do not want to add an enty from vm_emiengregi use emiengregi=NULL |
eminegregi |
enty that is read in from vm_eminegregi, vector is possible e.g. c("co2","co2cement"). If you do not want to add an enty from vm_emiengregi use emiengregi=NULL |
Lavinia Baumstark
## Not run: emi <- readEmissions(gdx,emiengregi=c("n2o","co2"),eminegregi=NULL)
## Not run: emi <- readEmissions(gdx,emiengregi=c("n2o","co2"),eminegregi=NULL)
Read Energy Investments data from a GDX file into a MagPIE object.
readEnergyInvestments(gdx, field = "l")
readEnergyInvestments(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up') |
Energy Investments data as MAgPIE object
Jonas Hoersch
## Not run: invests <- readEnergyInvestments(gdx)
## Not run: invests <- readEnergyInvestments(gdx)
Read final energy data from a GDX file into a magpie object.
readFE(gdx)
readFE(gdx)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
Lavinia Baumstark
## Not run: fe <- readFE(gdx)
## Not run: fe <- readFE(gdx)
Read Fuelex data for the specified enty (energy type) from a GDX file into a magpie object.
readFuelex(gdx, enty = NULL)
readFuelex(gdx, enty = NULL)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
enty |
one of the energy types in REMIND: "pecoal", "pegas", "peoil", "pebiolc", "peur", etc. |
Fuelex data as MAgPIE object
David Klein, Lavinia Baumstark
## Not run: coal <- readFuelex(gdx, enty = "pecoal") gas <- readFuelex(gdx, enty = "pegas") ## End(Not run)
## Not run: coal <- readFuelex(gdx, enty = "pecoal") gas <- readFuelex(gdx, enty = "pegas") ## End(Not run)
Read Fuel supply costs data from a GDX file into a magpie object.
readFuelSupplyCosts(gdx, field = "l")
readFuelSupplyCosts(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up') |
Fuel supply costs data as MAgPIE object
Jonas Hoersch
## Not run: readFuelSupplyCosts(gdx)
## Not run: readFuelSupplyCosts(gdx)
Read GDP|MER data from a GDX file into a magpie object.
readGDPMER(gdx, field = "l")
readGDPMER(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up' |
Jonas Hoersch
## Not run: gdp <- readGDPMER(gdx)
## Not run: gdp <- readGDPMER(gdx)
Read Investments|Non-ESM data from a GDX file into a magpie object.
readInvestmentsNonESM(gdx, field = "l")
readInvestmentsNonESM(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up') |
Investments|Non-ESM data as MAgPIE object
Jonas Hoersch
## Not run: readInvestmentsNonESM(gdx)
## Not run: readInvestmentsNonESM(gdx)
Read non-Energy Abatement costs data from a GDX file into a magpie object.
readNonEnergyAbatementCosts(gdx)
readNonEnergyAbatementCosts(gdx)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
non-Energy Abatement costs data as MAgPIE object
Jonas Hoersch
## Not run: readNonEnergyAbatementCosts(gdx)
## Not run: readNonEnergyAbatementCosts(gdx)
Read OandM costs data from a GDX file into a magpie object.
readOandMcosts(gdx, field = "l")
readOandMcosts(gdx, field = "l")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
field |
one of 'l', 'm', 's', 'lo', 'up') |
OandM costs data as MAgPIE object
Jonas Hoersch
## Not run: readOandMcosts(gdx)
## Not run: readOandMcosts(gdx)
Read Population data from a GDX file into a magpie object.
readPopulation(gdx)
readPopulation(gdx)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
Lavinia Baumstark
## Not run: gdp <- readPopulation(gdx)
## Not run: gdp <- readPopulation(gdx)
Read PVP data of a certain commodity from a GDX file into a magpie object.
readPVP(gdx, level = "glo", enty = "good")
readPVP(gdx, level = "glo", enty = "good")
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
level |
spartiel resolution "glo" = global or "reg" = regional |
enty |
one of the traded commodities in REMIND: "good", "pecoal", "pegas", "peoil", "pebiolc", "peur", "perm" |
PVP data as MAgPIE object
Jonas Hoersch
## Not run: coal <- readPVP(gdx, enty = "pecoal") gas <- readPVP(gdx, enty = "pegas") ## End(Not run)
## Not run: coal <- readPVP(gdx, enty = "pecoal") gas <- readPVP(gdx, enty = "pegas") ## End(Not run)
read in a valid MIF (or CSV) reporting file and return data as a quitte-object
readReportingMIF(pathToMIF, RData = FALSE, verbose = TRUE)
readReportingMIF(pathToMIF, RData = FALSE, verbose = TRUE)
pathToMIF |
character. Path to a valid MIF reporting file. |
RData |
logical. if true data is saved in Rdata format to save read-in time |
verbose |
logical. If true (un)helpful information will be display. |
quitte object
Anselm Schultes, Jerome Hilaire, Lavinia Baumstark, David Klein
## Not run: qd <- readReportingMIF('/my/magic/remind/run/REMIND_generic.mif') qd <- readReportingMIF('/my/magic/remind/run/REMIND_generic.csv') ## End(Not run)
## Not run: qd <- readReportingMIF('/my/magic/remind/run/REMIND_generic.mif') qd <- readReportingMIF('/my/magic/remind/run/REMIND_generic.csv') ## End(Not run)
Read coefficients for bioenergy prices from gdx and calculate bioenergy supplycurve. Also read the actual demand for bioenergy from gdx.
readSupplycurveBio( outputdirs, userfun = function(param, x) { return(param[[1]] + param[[2]] * x) }, mult_on = "all" )
readSupplycurveBio( outputdirs, userfun = function(param, x) { return(param[[1]] + param[[2]] * x) }, mult_on = "all" )
outputdirs |
Vector providing the folders that contain the gdx files |
userfun |
Function that was used to fit the supplycurve. Is needed to calculate the supplycurve correctly.
User can provide a functional form using the following syntax: |
mult_on |
Should the multiplication factor (read from the gdx) be applied on the entire forumla ("all"), or on the slope only ("slope"). Use "all" for REMIND 2.0 (this is the default) and "slope" for REMIND 1.7 |
David Klein
Read Time Step Weight from a GDX file into a magpie object.
readTimeStepWeight(gdx)
readTimeStepWeight(gdx)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
Time Step Weight as MAgPIE object
Jonas Hoersch
## Not run: readTimeStepWeight(gdx)
## Not run: readTimeStepWeight(gdx)
Read Exports or Imports of a commodity from a GDX file into a magpie object.
readTrade(gdx, type, variable)
readTrade(gdx, type, variable)
gdx |
a GDX list as created by readGDX, or the file name of a gdx file(file name is recommended as this speeds up the code) |
type |
one of |
variable |
one of the traded commodities in REMIND: good, pecoal, pegas, peoil, pebiolc, peur, perm |
Trade data as MAgPIE object
Niklas Roming
## Not run: coal <- readTrade(gdx, "Exports", "pecoal") # Coal exports gas <- readTrade(gdx, "Imports", "pegas") # Gas exports ## End(Not run)
## Not run: coal <- readTrade(gdx, "Exports", "pecoal") # Coal exports gas <- readTrade(gdx, "Imports", "pegas") # Gas exports ## End(Not run)
Read in capacity information from GDX file, information used in convGDX2MIF.R for the reporting
reportCapacity( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = gdx_ref )
reportCapacity( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = gdx_ref )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
gdx_ref |
a GDX object as created by readGDX, or the path to a gdx of the reference run. It is used to guarantee consistency before 'cm_startyear' for capacity variables using time averaging. |
MAgPIE object - contains the capacity variables
Lavinia Baumstark, Christoph Bertram
## Not run: reportCapacity(gdx) ## End(Not run)
## Not run: reportCapacity(gdx) ## End(Not run)
Read in capital stock information from GDX file, information used in convGDX2MIF.R for the reporting
reportCapitalStock( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = gdx_ref )
reportCapitalStock( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = gdx_ref )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
gdx_ref |
a GDX object as created by readGDX, or the path to a gdx of the reference run. It is used to guarantee consistency before 'cm_startyear' for capacity variables using time averaging. |
MAgPIE object - contains the capital stock variables
Lavinia Baumstark; Michaja Pehl
## Not run: reportCapitalStock(gdx) ## End(Not run)
## Not run: reportCapitalStock(gdx) ## End(Not run)
Read climate assessment variables from GDX file
reportClimate(gdx, output)
reportClimate(gdx, output)
gdx |
A GDX as created by readGDX, or the file name of a gdx |
output |
Existing magclass object containing data generated by other report*.R functions |
Tonn Rüter
## Not run: output <- reportMacroEconomy(gdx, NULL) reportClimate(gdx, output) ## End(Not run)
## Not run: output <- reportMacroEconomy(gdx, NULL) reportClimate(gdx, output) ## End(Not run)
Read in cost information from GDX file, information used in convGDX2MIF.R for the reporting
reportCosts( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportCosts( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
MAgPIE object - contains the cost variables
David Klein
## Not run: reportCosts(gdx)
## Not run: reportCosts(gdx)
Read in GDX and calculate variables that need variables produced by other report*.R functions
reportCrossVariables( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportCrossVariables( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Lavinia Baumstark, Falk Benke
## Not run: reportCrossVariables(gdx)
## Not run: reportCrossVariables(gdx)
The DIETER data is appended to a REMIND_generic_.mif file and the new mif is saved in different location, i.e sub directory "DIETER".
reportDIETER(dieterDatafile = "report_DIETER.gdx", outputDir = ".")
reportDIETER(dieterDatafile = "report_DIETER.gdx", outputDir = ".")
dieterDatafile |
full path with name of dieter gdx file. |
outputDir |
path to the output folder, default is current folder. |
Chen Gong, Pratik Agrawal
Read in GDX and calculate emissions, used in convGDX2MIF.R for the reporting
reportEmi( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportEmi( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Felix Schreyer
## Not run: reportEmi(gdx) ## End(Not run)
## Not run: reportEmi(gdx) ## End(Not run)
Read in air pollution emission information from GDX file, information used in convGDX2MIF.R for the reporting
reportEmiAirPol( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportEmiAirPol( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
MAgPIE object - contains the emission variables
Antoine Levesque, Jerome Hilaire
## Not run: reportEmiAirPol(gdx)
## Not run: reportEmiAirPol(gdx)
Reports emissions & air pollutant values from GDX for climate assessment in between Nash iterations before some of the energy system variables are defined. The report contains only a subset of reported emissions, with the main difference being that Emi|CO2|Energy and Industrial Processes is calculated from the difference between total and LUC emissions. Only global values from this function should be used, as it also skips the subtraction of certain non-regional sources, such as bunkers, from the regional information
reportEmiForClimateAssessment( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportEmiForClimateAssessment( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Gabriel Abrahao, Tonn Rüter
## Not run: reportEmiForClimateAssessment(gdx) ## End(Not run)
## Not run: reportEmiForClimateAssessment(gdx) ## End(Not run)
This function returns a magpie object containing the reporting the jobs for different technologies
reportEmployment(gdx, improvements, multiplier, subtype, shareManf, decline)
reportEmployment(gdx, improvements, multiplier, subtype, shareManf, decline)
gdx |
A gdx file output from a REMIND run |
improvements |
Either "None", "CEEW", "Dias", "Rutovitz_aus", "Solar_found" or "All". Use "All" for all improvements. |
multiplier |
controls how the regional multiplier for non-oecd countries changes with time. |
subtype |
Subtype for how shares of solar rooftop, wind offshore, and small hydro are assumed in the future. Options "current", "irena", and "expert". See calcDspvShare for more information. |
shareManf |
Either "current" or "local". Current implies current shares of world manufacture remain same until 2050, current means that in 2050 all countries manufacture required components locally. |
decline |
How should the employment factors change over time? "capcosts" means according to capital costs. "static" means it doesn't change |
A magpie object
Aman Malik
## Not run: reportEmployment(gdx, improvements = "All", multiplier = "own", subtype = "expert", shareManf = "local", decline = "capcosts") ## End(Not run)
## Not run: reportEmployment(gdx, improvements = "All", multiplier = "own", subtype = "expert", shareManf = "local", decline = "capcosts") ## End(Not run)
Read in price information from GDX file, information used in convGDX2MIF.R for the reporting
reportEnergyInvestment( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = NULL )
reportEnergyInvestment( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = NULL )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
gdx_ref |
a GDX object as created by readGDX, or the path to a gdx of the reference run. It is used to guarantee consistency before 'cm_startyear' for investment variables using time averaging. |
MAgPIE object - contains the price variables
Anastasis Giannousaki
## Not run: reportEnergyInvestment(gdx) ## End(Not run)
## Not run: reportEnergyInvestment(gdx) ## End(Not run)
This function returns a magpie object containing the reporting values of the extraction sector. Values include quantities extracted, average and supply costs for coal, oil, gas and uranium.
reportExtraction( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportExtraction( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
A gdx object |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
A magpie object
Jerome Hilaire, Lavinia Baumstark
## Not run: reportExtraction(gdx) ## End(Not run)
## Not run: reportExtraction(gdx) ## End(Not run)
Read in final energy information from GDX file, information used in convGDX2MIF.R for the reporting
reportFE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportFE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Renato Rodrigues, Felix Schreyer
## Not run: reportFE(gdx)
## Not run: reportFE(gdx)
This function provides a post-processing calculation of LCOE (Levelized Cost of Energy) for energy conversion technologies in REMIND. It includes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy. This script calculates two different types of LCOE: average LCOE (standing system) and marginal LCOE (new plant). The average LCOE reflect the total cost incurred by the technology deployment in a specific time step divided by its energy output. The marginal LCOE estimate the per-unit lifetime cost of the output if the model added another capacity of that technology in the respective time step. The marginal LCOE are calculate in two versions: 1) with fuel prices and co2 taxes of the time step for which the LCOE are calculated (time step prices), or 2) with an intertemporal weighted-average of fuel price and co2 taxes over the lifetime of the plant (intertemporal prices).
reportLCOE(gdx, output.type = "both")
reportLCOE(gdx, output.type = "both")
gdx |
a GDX object as created by readGDX, or the path to a gdx |
output.type |
string to determine which output shall be produced. Can be either "average" (returns only average LCOE), "marginal" (returns only marginal LCOE), "both" (returns marginal and average LCOE) and and "marginal detail" (returns table to trace back how marginal LCOE are calculated). |
MAgPIE object - LCOE calculated by model post-processing. Two types a) standing system LCOE b) new plant LCOE.
Felix Schreyer, Robert Pietzcker, Lavinia Baumstark
## Not run: reportLCOE(gdx) ## End(Not run)
## Not run: reportLCOE(gdx) ## End(Not run)
Read in macro economy information from GDX file, information used in convGDX2MIF.R for the reporting
reportMacroEconomy( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportMacroEconomy( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Lavinia Baumstark, Anselm Schultes
## Not run: reportMacroEconomy(gdx) ## End(Not run)
## Not run: reportMacroEconomy(gdx) ## End(Not run)
Calculate and report relevant fossil fuel cost and quantity variables from MOFEX standalone model.
reportMOFEX(gdx, gdx_ref = NULL, file = NULL, scenario = "default")
reportMOFEX(gdx, gdx_ref = NULL, file = NULL, scenario = "default")
gdx |
the filepath to a gdx |
gdx_ref |
reference-gdx for policy costs, a GDX as created by readGDX, or the file name of a gdx |
file |
path to output .mif file |
scenario |
scenario name that is used in the *.mif reporting |
MAgPIE object - contains the output from a MOFEX standalone run
Steve Bi
convGDX2MIF
reportPE
reportCosts
## Not run: reportMOFEX(gdx) ## End(Not run)
## Not run: reportMOFEX(gdx) ## End(Not run)
Read in primary energy information from GDX file, information used in convGDX2MIF.R for the reporting
reportPE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportPE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Lavinia Baumstark
## Not run: reportPE(gdx) ## End(Not run)
## Not run: reportPE(gdx) ## End(Not run)
Read in GDX and calculate policy costs functions
reportPolicyCosts( gdx, gdx_ref, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportPolicyCosts( gdx, gdx_ref, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
gdx_ref |
a reference GDX as created by readGDX, or the file name of a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Lavinia Baumstark
## Not run: reportPolicyCosts(gdx)
## Not run: reportPolicyCosts(gdx)
Read in price information from GDX file, information used in convGDX2MIF.R for the reporting
reportPrices( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = NULL )
reportPrices( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150), gdx_ref = NULL )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
gdx_ref |
a GDX object as created by readGDX, or the path to a gdx of the reference run. It is used to guarantee consistency for Moving Avg prices before cm_startyear |
MAgPIE object - contains the price variables
Alois Dirnaichner, Felix Schreyer, David Klein, Renato Rodrigues, Falk Benke
## Not run: reportPrices(gdx) ## End(Not run)
## Not run: reportPrices(gdx) ## End(Not run)
Add SDP variables to mif, used in convGDX2MIF.R for the reporting
reportSDPVariables( gdx, output = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportSDPVariables( gdx, output = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
t |
temporal resolution of the reporting |
MAgPIE object - contains the SDP
Sebastian Rauner
## Not run: reportSDPVariables(gdx, output, t)
## Not run: reportSDPVariables(gdx, output, t)
Read in secondary energy information from GDX file, information used in convGDX2MIF.R for the reporting
reportSE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportSE( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Gunnar Luderer, Lavinia Baumstark, Felix Schreyer, Falk Benke
## Not run: reportSE(gdx) ## End(Not run)
## Not run: reportSE(gdx) ## End(Not run)
Read in tax information from GDX file, information used in convGDX2MIF.R for the reporting
reportTax( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportTax( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX as created by readGDX, or the file name of a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
Renato Rodrigues, Lavinia Baumstark, Christoph Bertram
## Not run: reportTax(gdx)
## Not run: reportTax(gdx)
Read in technology information from GDX file, information used in convGDX2MIF.R for the reporting
reportTechnology( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportTechnology( gdx, output = NULL, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
output |
a magpie object containing all needed variables generated by other report*.R functions |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
MAgPIE object - contains the technology variables
Michaja Pehl, Lavinia Baumstark
## Not run: reportTechnology(gdx) ## End(Not run)
## Not run: reportTechnology(gdx) ## End(Not run)
Read in trade information from GDX file, information used in convGDX2MIF.R for the reporting
reportTrade( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
reportTrade( gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150) )
gdx |
a GDX object as created by readGDX, or the path to a gdx |
regionSubsetList |
a list containing regions to create report variables region aggregations. If NULL (default value) only the global region aggregation "GLO" will be created. |
t |
temporal resolution of the reporting, default: t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) |
MAgPIE object - contains the price variables
Lavinia Baumstark, Christoph Bertram, Anselm Schultes
## Not run: reportTrade(gdx)
## Not run: reportTrade(gdx)
This function returns a magpie object containing the reporting the jobs for different technologies
runEmployment(pathToMIF, improvements, multiplier, subtype, shareManf, decline)
runEmployment(pathToMIF, improvements, multiplier, subtype, shareManf, decline)
pathToMIF |
A mif file putput from a REMIND run |
improvements |
Either "None", "CEEW", "Dias", "Rutovitz_aus","Solar_found" or "All". Use "All" for all improvements. |
multiplier |
controls how the regional multiplier for non-oecd countries changes with time. |
subtype |
Subtype for how shares of solar rooftop, wind offshore, and small hydro are assumed in the future. Options "current", "irena", and "expert". See calcDspvShare for more information. |
shareManf |
Either "current" or "local". Current implies current shares of world manufacture remain same until 2050, current means that in 2050 all countries manufacture required components locally. |
decline |
How should the employment factors change over time? "capcosts" means according to capital costs. "static" means it doesn't change |
A magpie object
Aman Malik
## Not run: runEmployment(pathToMIF, improvements = "All", multiplier = "own", subtype = "expert", shareManf = "local", decline = "capcosts") ## End(Not run)
## Not run: runEmployment(pathToMIF, improvements = "All", multiplier = "own", subtype = "expert", shareManf = "local", decline = "capcosts") ## End(Not run)
searches all scenario config files of REMIND directory for a switch and prints the occurences
switchValuesScenConf(switchname = NULL, directory = ".")
switchValuesScenConf(switchname = NULL, directory = ".")
switchname |
string with switch that is searched in scenario config files. If NULL or ”, prints all switches with only one value in main.gms and scenario config files |
directory |
path to REMIND directory |
values used in default and all scenario configs if switchname = NULL, then list of all unique values
Oliver Richters
Test Ranges on Variables in magpie Objects
test_ranges( data, tests, reaction = c("warning", "stop"), report.missing = FALSE )
test_ranges( data, tests, reaction = c("warning", "stop"), report.missing = FALSE )
data |
A |
tests |
A list of tests to perform, where each tests consists of:
- A regular expression to match variables names in |
reaction |
A character string, either |
report.missing |
If set to |
Michaja Pehl
require(dplyr) require(tidyr) (data <- bind_rows( expand_grid(variable = 'Foo Share (%)', value = c(-1, 0, 42, 100, 101)), expand_grid(variable = 'bar share (percent)', value = c(-1, 0, 42, 100, 101))) %>% group_by(variable) %>% mutate(year = 2000 + (1:n())) %>% ungroup() %>% select(year, variable, value) %>% as.magpie(spatial = 0, temporal = 1, data = 3)) tests <- list(list("Share.*\\((%|Percent)\\)$", low = 0, up = 100)) test_ranges(data, tests)
require(dplyr) require(tidyr) (data <- bind_rows( expand_grid(variable = 'Foo Share (%)', value = c(-1, 0, 42, 100, 101)), expand_grid(variable = 'bar share (percent)', value = c(-1, 0, 42, 100, 101))) %>% group_by(variable) %>% mutate(year = 2000 + (1:n())) %>% ungroup() %>% select(year, variable, value) %>% as.magpie(spatial = 0, temporal = 1, data = 3)) tests <- list(list("Share.*\\((%|Percent)\\)$", low = 0, up = 100)) test_ranges(data, tests)
toolRegionSubsets Returns a list of parent regions that are equal to a child mapping union of region mappings.
toolRegionSubsets( gdx = NULL, map = NULL, parentMapping = NULL, singleMatches = FALSE, removeDuplicates = TRUE, regionIndex = NULL, countryIndex = NULL )
toolRegionSubsets( gdx = NULL, map = NULL, parentMapping = NULL, singleMatches = FALSE, removeDuplicates = TRUE, regionIndex = NULL, countryIndex = NULL )
gdx |
a GDX as created by readGDX, or the file name of a gdx. Gdx file containing child mapping regions list. |
map |
alternative to gdx file. You can also provide a child mapping csv file. |
parentMapping |
parent mapping or csv file (if NULL it uses the "regionmappingH12.csv"). |
singleMatches |
if true, includes single element matches in the return list. Default: FALSE |
removeDuplicates |
if true, removes from the return list identic matches (a region with the same name and countries for both parent and child mappings). Default: TRUE |
regionIndex |
Name or index of the region column to be used in the parent mapping (if not set the column with less unique elements from the last two columns will be used). |
countryIndex |
Name or index of the country column to be used in parent mapping (if not set the column with more unique elements from the last two columns will be used). |
return: returns a list of parent regions that are equal to a child mapping union of region mappings.
Renato Rodrigues
## Not run: toolRegionSubsets(gdx)
## Not run: toolRegionSubsets(gdx)
Take a character vector of variables names with hierarchical structure
indicated by |
in the name and convert it into a hierarchical
structure of named lists.
variablesAsList( x, entry = c("NULL", "name", "INFO"), usePlus = FALSE, details = NULL )
variablesAsList( x, entry = c("NULL", "name", "INFO"), usePlus = FALSE, details = NULL )
x |
A character vector of variable names, a quitte object, or a character vectors of paths to mif files. |
entry |
A string determining the entries of all leafs and the nodes
which represent variables in |
usePlus |
|
details |
|
A hierarchical named list.
Christof Schoetz
createVarListHtml
for creating an HTML-file of such a list.
vars <- c( "Emi|GHG|CO2", "Emi|GHG|CH4", "Emi|NOX", "FE", "FE|Buildings", "FE|Industry", "FE|Transport") v <- variablesAsList(vars) ## Not run: View(v) v <- variablesAsList(vars, entry = "name") ## Not run: mip::showLinePlots(data, v$Emi$GHG$nm) details <- data.frame(name = vars, nr = seq_along(vars)) v <- variablesAsList(vars, entry = "INFO", details = details) ## Not run: View(v) ## Not run: loadModeltest() v <- variablesAsList(data, entry = "INFO") View(v) # Include structure induced by |+|,|++|, ...: vp <- variablesAsList(data, entry = "INFO", usePlus = TRUE) View(vp) ## End(Not run) ## Not run: View(variablesAsList("path/to/scenario.mif"))
vars <- c( "Emi|GHG|CO2", "Emi|GHG|CH4", "Emi|NOX", "FE", "FE|Buildings", "FE|Industry", "FE|Transport") v <- variablesAsList(vars) ## Not run: View(v) v <- variablesAsList(vars, entry = "name") ## Not run: mip::showLinePlots(data, v$Emi$GHG$nm) details <- data.frame(name = vars, nr = seq_along(vars)) v <- variablesAsList(vars, entry = "INFO", details = details) ## Not run: View(v) ## Not run: loadModeltest() v <- variablesAsList(data, entry = "INFO") View(v) # Include structure induced by |+|,|++|, ...: vp <- variablesAsList(data, entry = "INFO", usePlus = TRUE) View(vp) ## End(Not run) ## Not run: View(variablesAsList("path/to/scenario.mif"))