Skip to contents

Class BareCycle.

Objects from the Class

Objects can be created by calls of the form pcCycle(nseasons) or new("BareCycle", nseasons).

Class "BareCycle" represents the number of seasons and is sufficient for many computations.

Slots

nseasons:

Object of class "integer", the number of seasons.

Extends

Class "BasicCycle", directly.

Methods

coerce

signature(from = "BuiltinCycle", to = "BareCycle"): ...

initialize

signature(.Object = "BareCycle"): ...

nSeasons

signature(object = "BareCycle"): ...

show

signature(object = "BareCycle"): ...

Author

Georgi N. Boshnakov

See also

pcCycle for creation of cycle objects and extraction of cycle part of time series,

BuiltinCycle-class, SimpleCycle-class,

DayWeekCycle-class, MonthYearCycle-class, OpenCloseCycle-class, QuarterYearCycle-class PartialCycle-class,

BasicCycle-class (virtual, for use in signatures)

Examples

pcCycle(5)
#> Object from class 'BareCycle'
#> Number of seasons: 5 
cycle <- new("BareCycle", 5)
identical(new("BareCycle", 5), pcCycle(5)) # TRUE
#> [1] TRUE

unitSeason(cycle)
#> [1] "Season"
unitCycle(cycle)
#> [1] "Cycle"
allSeasons(cycle)
#> [1] "S1" "S2" "S3" "S4" "S5"
seqSeasons(cycle)
#> [1] 1 2 3 4 5

cycle[]
#> [1] "S1" "S2" "S3" "S4" "S5"
cycle[3]
#> [1] "S3"

## if cycle represents 5-days week one may prefer:
BuiltinCycle(5)
#> Object from class 'PartialCycle'
#>     partial cycle of 'DayWeekCycle', seasons: 1, 2, 3, 4, 5
#> Cycle start: Monday