Skip to contents

Classes

Data structures of the key model components.

storage-class
An S4 class to represent storage type of technological process.
supply-class
An S4 class to represent a supply of a commodity
class-constraint summand-class experimental
An S4 class to represent a custom constraint.
subsidy-class
An S4 class to represent a commodity subsidy
tax-class
An S4 class to represent a commodity tax
get_process_class()
Get class of processes
class-calendar
An S4 class to represent sub-annual time resolution structure.
class-commodity
An S4 class to represent a commodity
class-demand
An S4 class to declare a demand in the model
class-export
An S4 class to represent commodity export to the rest of the world.
class-horizon
An S4 class to represent model/scenario planning horizon with intervals (year-steps)
class-import
An S4 class to represent commodity import from the rest of the world.
class-modInp
An S4 class to represent model input
class-modOut
An S4 class to store results of a solved scenario
class-parameter
An S4 class to specify the model set or parameter
class-technology
An S4 class to represent technology
class-trade
An S4 class to represent inter-regional trade
class-weather
S4 class to represent weather factors
class-config
An S4 class to represent default model configuration.
class-costs experimental
An S4 class to add costs to objective function
class-model model
An S4 class to represent model
class-repository
An S4 class to store the model objects.
class-scenario scenario
An S4 class to represent scenario, an interpolated and/or solved model.
class-settings
An S4 class to represent scenario settings
.upgrade_summand()
An S4 class to represent a summand in a constraint.

Building a model

Functions to create model components.

newCommodity()
Create new commodity object
newDemand() update(<demand>)
Create new demand object
newExport()
Create new export object
newHorizon() update(<horizon>) setHorizon(<config>) update(<config>)
Create a new object of class 'horizon'
newImport()
Create new export object
newRegistry() experimental
Create a new registry object.
newScenario()
Generate a new scenario object
newSupply()
Constructor for supply object.
newTrade()
Create new trade object
newWeather()
Create new weather object
newCalendar()
Generate a new calendar object from
newConstraint() isConstraint() newConstraintS()
Create constraint object to add custom constraints to the model.
newCosts()
Create new costs object
newModel() setHorizon(<model>) getHorizon(<model>)
Create new model object
newRepository()
A constructor for the repository class
newSub()
Create a new subsidy object
newTax()
Create a new tax object
newStorage()
Create new storage object
newTechnology() update(<technology>)
Create a new "technology" object.
make_timetable()
Create timetable of time-slices from given structure as a list
make_scenario_dirname()
Make a name for a scenario directory
update(<export>) update(<weather>)
Update export object
update(<supply>)
Update supply object
update(<storage>) update(<trade>) update(<import>)
Update trade object
update_parameter()
Update parameter in the scenario by adding data to it
add(<repository>) add(<model>)
Add an object to the model's repository
convert(<character>) convert(<numeric>) add_to_convert(<character>,<character>,<numeric>)
Convert units

Configuration and Settings

Model configuration and scenario settings

class-config
An S4 class to represent default model configuration.
class-settings
An S4 class to represent scenario settings
compare_interp_settings()
Compare interpolation settings (size & build time) for a model
compare_solve_settings()
Compare interpolation settings AND solvers for a model
class-calendar
An S4 class to represent sub-annual time resolution structure.
newCalendar()
Generate a new calendar object from
plot(<calendar>) autoplot(<calendar>)
Visualize a Calendar object
class-horizon
An S4 class to represent model/scenario planning horizon with intervals (year-steps)
newHorizon() update(<horizon>) setHorizon(<config>) update(<config>)
Create a new object of class 'horizon'
plot(<horizon>) autoplot(<horizon>)
Visualize a Horizon object
calendars
Example calendars
horizons
Example planning horizons

Solving

interpolate_bounds()
Interpolate lower and upper bounds
interpolate_model()
Interpolate a model into a solver-ready scenario
interpolate_numpar()
Interpolate numerical parameter for missing years
interpolate_parameters()
Interpolate all year-indexed numeric/bounds parameters of a scenario
write_script() write_sc() write.sc()
Write scenario object as a Python, Julia, GAMS, or MathProg script with data files to a directory
write_technology_xlsx()
Write technology object(s) to an Excel workbook
read_solution() read(<scenario>)
Read solution
read_technology_xlsx()
Read technology object(s) from an Excel workbook
solve_mod() solve_scen()
Solve a model or an interpolated scenario built with the new pipeline
solve_model() solve_scenario()
Solve a model or scenario (legacy names; new pipeline)
build_mappings()
Build mapping parameters for a scenario, in recipe (dependency) order
load_mapping_spec()
Load the mapping specification
mappings_by_recipe()
Group mapping specs by recipe, in evaluation order
trim_parameters_by_maps()
Trim numeric/bounds parameters to the domain of the maps that index them
validate_scenario_parameters()
Validate interpolated scenario parameters

Remote solver (NEOS)

neos_ping() neos_list_categories() neos_list_solvers() neos_get_template()
NEOS Server client (query the remote solver service)
neos_build_gams_text_job()
Build a NEOS GAMS job from a text-mode scenario directory (no input GDX)
neos_build_gams_xml()
Assemble a NEOS GAMS job document
neos_gams_inline()
Inline a GAMS model's $include files into one self-contained string
neos_submit_job() neos_job_status() neos_completion_code() neos_final_results() neos_get_output_file() neos_wait()
Submit and manage a NEOS job

Reporting

report()
Generate a summary report for an energyRt object
report_html()
Generate an HTML report for an energyRt object
report_pdf()
Generate a PDF report for an energyRt object
report_tex()
Generate a LaTeX report for an energyRt object

Data manimulation

convert(<character>) convert(<numeric>) add_to_convert(<character>,<character>,<numeric>)
Convert units
convert_data
Basic units conversion database for convert methods
apply_to_scenario_data()
Apply function to scenario data
getData() get_data()
Extract data from energyRt objects
getObject()
Retrieve model objects from a repository, model or scenario
getMix()
Extract a tidy mix (generation, capacity, fuel) from a solved scenario
findData()
Performs search for available data in scenario object.
findDuplicates()
Function to find duplicated values in interpolated scenario.
en_replace_specials() en_has_specials() en_find_specials()
Find and replace special characters
find_in_model()
Find where value(s) are stored across a model's objects
renameSets()
Rename data.frame columns of list of data.frames.
revalueSets()
Replace specified values with new values in factor or character columns of a data.frame.
size()
Size of an object
model_size()
Size estimate of an interpolated scenario and the result of folding
hour2HOUR()
Convert hours (integer) values to HOUR set 'hNN'
yday2YDAY()
Convert year-days to YDAY set 'dNNN'
tsl_formats tsl_sets dtm2tsl() tsl2dtm()
Common formats of time-slices.
tsl2year() tsl2yday() tsl2hour() tsl2month()
Mapping function between time-slices and day of the year
tsl_guess_format()
Guess format of time-slices
drop_na_cols()
Drop columns in a data.frame with all NA values
obj2mem()
Loads objects from disk to memory
isInMemory()
Is object stored in memory?
register() experimental
Register an object in the registry.
get_registry()
Returns the current registry object.
save_scenario()
Save scenario object on disk in parquet format using arrow package.
load_scenario()
Load scenario (in progress)
utopia
UTOPIA reference maps
utopia_demand
UTOPIA electricity load shape
utopia_modules
UTOPIA model modules
utopia_profiles()
UTOPIA input profiles (deterministic)
utopia_stock
UTOPIA base-year capacity stock
utopia_weather
UTOPIA representative capacity-factor profiles

Visualisation

draw()
Draw a schematic representation of a process
autoplot(<commodity>)
Visualize a Commodity object
autoplot(<tax>) autoplot(<sub>) autoplot(<constraint>)
Plot a tax, subsidy or user constraint over years
autoplot(<supply>) autoplot(<import>) autoplot(<export>) autoplot(<technology>) autoplot(<storage>)
Visualize a process object over years
autoplot(<scenario>)
Plot mixes from a solved scenario
plot(<calendar>) autoplot(<calendar>)
Visualize a Calendar object
plot_demand() autoplot(<demand>)
Visualize a demand object
plot_heatmap()
Heatmap of timeslice-indexed values over a calendar
plot(<horizon>) autoplot(<horizon>)
Visualize a Horizon object
plot_process_windows() autoplot(<model>) autoplot(<repository>)
Plot process investment / availability windows
plot_share_frontier()
Plot feasible share-mix diagram for technology inputs/outputs
plot_trade_map() autoplot(<trade>)
Map inter-regional trade routes
plot_weather() autoplot(<weather>)
Visualize a weather object
set_progress_bar() show_progress_bar()
Switch on/off and select/customize progress bar
design()
Generate an R script that recreates an energyRt object

Validation

check_name()
Check validity of object's names used in sets
levcost()
Levelized cost of commodity production
tech_share_frontier()
Extract feasible share ranges for grouped inputs/outputs

Exporting

print()
Print methods for the energyRt classes
summary(<model>) summary(<scenario>)
Summarize a model or scenario

energyRt options and settings

utils

en_install_deps()
Install the energyRt dependency library layer
en_install_julia_pkgs()
Install Julia packages
en_install_python_deps()
Install Python/Pyomo dependencies
en_setup()
Set up energyRt after installation
en_check_glpk() en_check_julia() en_check_python() en_check_pyomo() en_check_gams() en_check_gdx() en_check_julia_pkgs() en_check_dependencies()
Detect external solver software and dependencies
en_check_packages()
Check R package and external-tool dependencies
collect_set_elements()
Search through model data for set elements
get_registry()
Returns the current registry object.
set_scenarios_path() get_scenarios_path()
Set or get directory for/with scenarios
get_arrow_format() set_arrow_format() get_arrow_compression() set_arrow_compression() get_arrow_compression_level() set_arrow_compression_level()
Arrow exchange-format options
getData() get_data()
Extract data from energyRt objects
getUnits(<commodity>) getUnits(<technology>) get_units()
Get parameter units for energyRt class objects
get_default_value()
Return default value for one, several, or all parameters
get_process_aux()
Get auxiliary commodities for each process
get_process_class()
Get class of processes
get_process_comm()
Commodities associated with a processes
get_process_inputs()
Get inputs of processes
get_process_invest_window()
Start and end years for process by region
get_process_outputs()
Get output commodities for each process
get_process_region()
Get regions for each process
get_process_timeframe()
Get operational timeframe of processes
get_region()
Collect the regions an object operates in
get_slot_doc()
Retrieve slot details in rd-format
get_neos_email() set_neos_email()
NEOS submission email
set_gams_path() get_gams_path() set_gdxlib_path() get_gdxlib_path() set_glpk_path() get_glpk_path() set_julia_path() get_julia_path() set_python_path() get_python_path()
Set GAMS and GDX library directory
complete_set()
Complete a data frame with missing set elements
expand_na_rows() expand_na_regions() expand_na_years() expand_sets()
Expand rows with NA values in set columns
countdown_timer()
Countdown timer to use in R scripts
is_any()
Check if an element of a set is "ANY*" or NA
map_comm_timeframe()
Operational timeframe of a commodities
named_list_to_df()
Convert a named list of vectors to a data frame