rts(x = NA, start = 1, deltat = 1, frequency = 1, end = <<see below>>, units = NULL, names = NULL, eps = .Options$ts.eps) is.rts(x) as.rts(x)
The is.rts function returns TRUE if x is of class "rts" and FALSE otherwise.
The as.rts function coerces calendar time series (objects of class "cts") and ts objects (time series objects from version 3.1 or earlier with a tsp attribute) to regular time series object of class "rts". If x is neither, then as.rts(x) returns rts(x).
Any data measured at regular time intervals can be represented as a regular time series. Hourly data might use an integer representing days for start and end with frequency=24 or deltat=1/24; daily data could use weeks with frequency=7 or deltat=1/7.
Time series objects are those that have a tspar attribute. For regular time series, the tspar attribute is an ordered vector with three labeled components start, deltat, and frequency. The tspar attribute may optionally have a units attribute giving the units in which deltat is measured.
Factors and data frames can be redefined as time series. The resulting series has class c("rts","factor") or c("rts","data.frame"). Beware that most time series operations are not well defined for factor data.
x <- rts(rnorm(100), start = c(1953, 4), frequency = 12) is.rts(x) lynx.rts <- as.rts(lynx) corn.rts <- rts(cbind(corn.rain, corn.yield), start = 1890, units = "years", names = c("rain", "yield"))