View source: R/class-calendar.R
newCalendar | R Documentation |
Calendars are defined by the structure of timeframes and time-slices
with shares of time in a year. The structure is represented by a
timetable
data.frame with levels of timeframes in the named columns,
and names of individual time-slices in every timeframe.
The number of rows in timetable
is equal to the total number
of time-slices on the lowest level.
Every timeframe is a set of timeslices ("slices") - a named fragment
of time with a year-share. Timeframes have nested structure.
Currently, every "parent"-timeframe must have the same number of
elements as the "child"-timeframe. (This may change in the future.)
character, annual, the top level of timeframes
character, (optional) first subannual level of timeframes
character, (optional) second subannual level of timeframes
character, (optional) further subannual levels of timeframes
character, name of the time-slices used in sets to refer to the lowest level of timeframes. If not specified, will be auto-created with the formula: {SLICE2}_{SLICE3}...
newCalendar(
name = "",
desc = "",
timetable = NULL,
year_fraction = 1,
default_timeframe = NULL,
misc = list(pSliceWeight = NULL),
...
)
name |
character. Name of the calendar object. Use to distingush between different structures and subsets of time-slices. The name is used to propose default folder names for the model/scenario scripts to separate solutions of the same scenario with different calendar objects. |
desc |
character. Description of the calendar object, for own references. |
timetable |
data.frame. Data frame with levels of timeframes in the named columns, and number of rows equal to the total number of time-slices on the lowest level. Every timeframe is a set of time-slices ("slices") - a named fragment of time with a year-share. Timeframes have nested structure where every slice serves as a parent for the lower level of time-slices (children). The first column is the name of the time-slice, the rest of the columns are the names of the timeframes. The values are the share of the year covered by the time-slice. The sum of the shares in every timeframe should be equal to 1. |
year_fraction |
numeric. The fraction of a year covered by the calendar, e.g. 1 for annual calendar (default), 0.5 for semi-annual, 0.25 for quarterly, etc. Currently must be specified manually for subset calendars to validate the sum of the shares. |
default_timeframe |
character. The name of the default level of the time-slices used in the model. If not specified, the lowest level of the timeframes is used as the default timeframe. |
misc |
list. Any additional data or information to store in the object. |
... |
ignored |
an object of class calendar
with the specified structure.
newCalendar()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.