tsp                  package: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 'NULL'.

Details:

     The 'tsp' attribute was previously described here as 'c(start(x),
     end(x), frequency(x))', but this is incorrect. It gives the start
     time _in time units_, the end time and the frequency.

     Assignments are checked for consistency.    

     Assigning 'NULL' which removes the 'tsp' attribute _and_ any
     '"ts"' (or '"mts"') class of 'x'.

References:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

See Also:

     'ts', 'time', 'start'.

