time(x) cycle(x)
The cycle function returns the position of each observation within the cycle of length frequency associated with the series. If x were monthly, this would be the month number: 1 for each January, etc.
Neither time.its nor time.cts return a time series since they may return a vector of class dates which is not an acceptable time series in the current implementation.
The method cycle.cts implicitly assumes a yearly cycle with one exception: If units="days" and frequency=7 then it uses days of the week to decide where the cycle begins (thereby implicitly assuming a weekly cycle).
The cycle function is not defined for irregular time series.
growth <- rts(sample(100:300,25), freq = 12, units = "months") fgrowth <- factor(cycle(growth), levels = 1:12, labels = month.name) tapply(growth, fgrowth, mean) # mean growth for each monthx <- rts(rnorm(100), start = c(1953, 4), frequency = 12) plot(time(x), x) # similar to ts.plot(x)