cts(x, start = dates("01/01/60"), units = "years", k.units = 1, frequency = 1, names = NULL) is.cts(x)
The is.cts function returns TRUE if x is of class "cts" and FALSE otherwise.
Time units are important in defining a calendar time series. The following table describes the default values of frequency and for the different values of units accepted in the actual implementation:
units frequency
"days" 365 "weeks" 52 "months" 12 "quarters" 4 "years" 1
When k.units is given, the figures above are divided by its value to provide the correct values of frequency(x) and deltat(x) under the same assumption of a yearly cycle. For example, bi-weekly data then will have a sampling frequency of 52/2 = 26 samples per year.
To change the length of the sampling cycle, you must provide a value for frequency. This will not change the dates of the observation times. For instance, if you have units="months" and frequency=3, you get a cycle of three observations every three months; if you have units="months", k.units=2 and frequency=3, you get a cycle of three observations every six months. The cycle function will return a values based on the frequency that you provide.
monthly.rain <- cts(rgamma(59, 3)*(1.5+cos((1:59)-1/12*2*pi)), start = dates("01/01/93"), units = "months")# Bi-weekly Maximum Temperature temp <- cts(rgamma(110, 65), start = dates("01/15/93"), units = "weeks", k = 2)