\Header{time}{Sampling Times of Time-Series}
\alias{start}{time}
\alias{end}{time}
\alias{frequency}{time}
\alias{tsp}{time}
\alias{tsp$\leftarrow $}{time}
\alias{time.default}{time}
\alias{start.default}{time}
\alias{end.default}{time}
\alias{frequency.default}{time}
\alias{time.ts}{time}
\alias{start.ts}{time}
\alias{end.ts}{time}
\alias{frequency.ts}{time}
\keyword{ts}{time}
\begin{Usage}
\begin{verbatim}
time(x, offset=0)
start(x)
end(x)
frequency(x)
tsp(x)
tsp(x) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] a time-series.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{time}, \texttt{start}, \texttt{end} and \texttt{frequency} are generic
functions with a \texttt{default} and a \texttt{ts} method (see
\texttt{\Link{methods}}).
\texttt{tsp(x)} returns \texttt{c(start(x),end(x),frequency(x))}.\end{Description}
\begin{Details}
\texttt{time} creates the vector of times at which a time series was sampled.
\texttt{offset} can be used to indicate when sampling took place
in the time unit.
\texttt{0} indicates the start of the unit, \texttt{0.5} the middle and
\texttt{1} the end of the interval.

\texttt{start} and \texttt{end} extract
the times the first and last observations were taken
and \texttt{frequency} returns the number of samples per unit time.

\texttt{tsp(x)} returns the vector \texttt{c(start(x),end(x),frequency(x))}.
It is included for compatibility with the S language.
In the assignment form, \texttt{value} must be a numeric of length 3 or
\texttt{NULL} which removes the \texttt{"tsp"} attribute \emph{and} the
\texttt{"ts"} class of \texttt{x}.\end{Details}
\begin{SeeAlso}
\texttt{\Link{ts}}, \texttt{\Link{window}}
and \texttt{\Link{system.time}} for CPU usage.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(presidents)
# a simple series plot
plot(c(time(presidents)), c(presidents), type="l")
\end{ExampleCode}
\end{Examples}

