Cyclic: Create objects from class Cyclic

View source: R/classCycle.R

CyclicR 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 pcCycle(x, ...).

start

a cycle-season pair, a datetime object, a Date object or any object that can be converted to datetime with as_datetime(start).

...

for Cyclic, arguments passed to pcCycle, used only if cycle is not from a cycle class.

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)

GeoBosh/pcts documentation built on Dec. 8, 2023, 9:57 p.m.