cts(x, start = dates("01/01/60"), units = "years", k.units = 1, frequency = 1, names = NULL) is.cts(x)
"dates"
,
a character string of the form "mm/dd/yy", or an integer representing
a Julian date.
"days", "weeks", "months", "quarters",
or
"years"
, representing the units in which the interval between
observations is measured.
units
, for example, monthly data are assumed to have
frequency=12
.
See the DETAILS section for the default relationships between
units
and
frequency
.
x
if
x
is a matrix or
a data frame, or the strings
"Series 1"
,
"Series 2"
, ..., etc. if
dimnames(x) = NULL
.
In the case of data frames,
names
overrides existing column names.
cts
function returns an object of class
"cts"
whose data values
are given by
x
.
The resulting series is considered regularly spaced.
is.cts
function returns
TRUE
if
x
is of class
"cts"
and
FALSE
otherwise.
This function is provided for the user who wants to keep calendar
information as corresponding observation times
and take advantage of objects of class
"dates"
in the
formatting, input, and output of, and operations on these times.
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
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.
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)