Skip to contents

The length of every leaf timeslice as the leaftable states it, with the unit in hours: unit_hours is one unit of the timeslice's timeframe (the declared unit, or the timeslice's own length when the timeframe declares none; it is share times the hours of the calendar's year), width the number of units the timeslice spans and weight the number of times it repeats. Their product, hours, is the time the timeslice stands for in a year. An hour of d365_h24 is 1 x 1 x 1; WIN_h12 of s4_h24 is one hour repeated on 90 days; the DAY block of winter in s4_hp3 is 11 hours wide on 90 days; a month of m12 is its own unit, once. See the section on share, width and weight in Calendar.

Usage

calendar_width(x)

Arguments

x

A Calendar.

Value

A data.frame with one row per leaf timeslice: the leaf column (named after the finest timeframe), unit_hours, width, weight and hours (unit_hours x width x weight).

Examples

head(calendar_width(calendar("s4_h24")))
#>      HOUR unit_hours width weight hours
#> 1 WIN_h00          1     1     90    90
#> 2 WIN_h01          1     1     90    90
#> 3 WIN_h02          1     1     90    90
#> 4 WIN_h03          1     1     90    90
#> 5 WIN_h04          1     1     90    90
#> 6 WIN_h05          1     1     90    90
head(calendar_width(calendar("s4_hp3")))
#>        HOUR unit_hours width weight hours
#> 1   WIN_DAY          1    11     90   990
#> 2  WIN_PEAK          1     4     90   360
#> 3 WIN_NIGHT          1     9     90   810
#> 4   SPR_DAY          1    11     92  1012
#> 5  SPR_PEAK          1     4     92   368
#> 6 SPR_NIGHT          1     9     92   828
calendar_width(calendar("m12"))
#>    MONTH unit_hours width weight hours
#> 1    m01        744     1      1   744
#> 2    m02        672     1      1   672
#> 3    m03        744     1      1   744
#> 4    m04        720     1      1   720
#> 5    m05        744     1      1   744
#> 6    m06        720     1      1   720
#> 7    m07        744     1      1   744
#> 8    m08        744     1      1   744
#> 9    m09        720     1      1   720
#> 10   m10        744     1      1   744
#> 11   m11        720     1      1   720
#> 12   m12        744     1      1   744