\Header{tsp}{Tsp Attribute of Time-Series-like Objects}
\alias{hasTsp}{tsp}
\alias{tsp<\Rdash}{tsp}
\keyword{ts}{tsp}
\begin{Description}\relax
\code{tsp} returns the \code{tsp} attribute (or \code{NULL}).
It is included for compatibility with S version 2. \code{tsp<-}
sets the \code{tsp} attribute. \code{hasTsp} ensures \code{x} has a
\code{tsp} attribute, by adding one if needed.\end{Description}
\begin{Usage}
\begin{verbatim}
tsp(x)
tsp(x) <- value
hasTsp(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector or matrix or univariate or multivariate time-series.
\item[\code{value}] a numeric vector of length 3 or \code{NULL}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{tsp} attribute was previously described here as
\code{c(start(x), end(x), frequency(x))}, but this is incorrect.
It gives the start time \emph{in time units}, the end time and
the frequency.

Assignments are checked for consistency.    

Assigning \code{NULL} which removes the \code{tsp} attribute
\emph{and} any \code{"ts"} class of \code{x}.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{ts}}, \code{\Link{time}}, \code{\Link{start}}.\end{SeeAlso}

