Cyclic {pcts} | R Documentation |
Create objects from class Cyclic
Description
Create objects from class Cyclic.
Usage
Cyclic(cycle, start = NULL, ...)
## S3 method for class 'Cyclic'
as.Date(x, ...)
## S3 method for class 'Cyclic'
date(x)
## S3 method for class 'PeriodicTimeSeries'
as.Date(x, ...)
Arguments
cycle |
a cycle object, a positive integer giving the number of seasons, or
any other object that can be used to create a cycle with
|
start |
a cycle-season pair, a datetime object, a Date object or any object
that can be converted to datetime with |
... |
for |
x |
a Cyclic object |
Value
for Cyclic
, an object from class "Cyclic"
See Also
BuiltinCycle
, pcCycle
for creation of cycle objects,
pcts
importing and creating periodic time series
Examples
## bare bone Cyclic starting at Cycle 1, season 1
Cyclic(4)
Cyclic(4, c(1,1)) # same
## with quarter/year cycle
qu <- Cyclic(BuiltinCycle(4), start = c(2020, 1))
start(qu)
as_datetime(qu)
date(qu) <- c(2009, 2)
qu
ap <- pcts(AirPassengers)
as.Date(ap)
[Package pcts version 0.15.7 Index]