Skip to contents

An S4 class to represent a commodity

Create class commodity

Usage

newCommodity(
  name = "",
  desc = "",
  limtype = "LO",
  timeframe = character(),
  unit = character(),
  agg = data.frame(),
  emis = data.frame(),
  misc = list()
)

Slots

name

character, a short name used in sets, no white spaces or special characters

limtype,

character or factor, the limit type of the commodity in balance equation ("LO" by default, meaning that the level of commodity in the model is satisfied with the lower bound)

timeframe

character, the default time-frame this commodity operates in the model (the lowest timeframe used by default)

unit

the main unit of the commodity used in the model, character string

emis

data.frame with emissions factors, columns:

comm

character string, name of the commodity

unit

character string, unit of the emission factor

emis

numeric, emission factor, applied to the consumed commodity (`@name`) by a technology with combustion parameter > 0, to calculate emissions of the commodity specified in the slot (`@emis$comm`).

agg

data.frame with aggregation parameters of several commodities into the `@name` commodity, with columns:

comm

character string, name of the commodity being aggregated

unit

numeric, unit of the commodity being aggregated

agg

numeric, aggregation parameter, applied to the commodity specified in the slot (`@agg$comm`) to calculate the `@name` commodity.

misc

list with miscellaneous information to store

desc

Examples

newCommodity(name = "ELC", desc = "Electricity")
#> An object of class "commodity"
#> Slot "name":
#> [1] "ELC"
#> 
#> Slot "desc":
#> [1] ""
#> 
#> Slot "limtype":
#> [1] LO
#> Levels: FX UP LO
#> 
#> Slot "timeframe":
#> character(0)
#> 
#> Slot "unit":
#> character(0)
#> 
#> Slot "emis":
#> [1] comm unit emis
#> <0 rows> (or 0-length row.names)
#> 
#> Slot "agg":
#> [1] comm unit agg 
#> <0 rows> (or 0-length row.names)
#> 
#> Slot "misc":
#> list()
#>