| tsp {stats} | R Documentation |
'Tsp' Attribute of Time-Series-like Objects
Description
tsp returns the tsp attribute (or NULL).
It is included for compatibility with S version 2. tsp<-
sets the tsp attribute. hasTsp ensures x has a
tsp attribute, by adding one if needed.
Usage
tsp(x)
tsp(x) <- value
hasTsp(x)
Arguments
x |
a vector or matrix or univariate or multivariate time-series. |
value |
a numeric vector of length 3 or |
Details
The tsp attribute gives the start time in time units,
the end time and the frequency (the number of observations per unit of
time, e.g. 12 for a monthly series).
The frequency may be fractional, see ts.
Assignments are checked for consistency.
Assigning NULL which removes the tsp attribute
and any "ts" (or "mts") class of x.
Value
An object which differs from x only in the tsp attribute
(unless NULL is assigned).
hasTsp adds, if needed, an attribute with a start time and
frequency of 1 and end time NROW(x).
References
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.