ts(data = NA, start = <<see below>>, frequency = 1, end = NULL, deltat = 1, names = <<see below>>, ts.eps = .Options$ts.eps) is.ts(x) as.ts(x)
is.ts returns TRUE if x is a time series object (has a tsp attribute), and returns FALSE otherwise.
as.ts returns x, if x is a time series, otherwise ts(x).
Time series objects are those that have an attribute tsp, which must be numeric of length 3. Multivariate time series objects also have attributes dim and (possibly) dimnames.
Multivariate time series are printed by default like a matrix with the tsp attribute printed last. Calling print.ts directly provides an alternative.
tsp(freeny.y) # [1] 1962.25 1971.75 4.00is.ts(freeny.y) # [1] T
# Define the matrix of related covariates as a time series and plot ts.freeny.x <- ts(freeny.x, start = 1962.25, frequency = 4) tsplot(ts.freeny.x, freeny.y)