\Header{time}{Sampling Times of Time Series}
\alias{cycle}{time}
\alias{deltat}{time}
\alias{frequency}{time}
\methalias{time.default}{time}
\keyword{ts}{time}
\begin{Description}\relax
\code{time} creates the vector of times at which a time series was sampled.

\code{cycle} gives the positions in the cycle of each observation.

\code{frequency} returns the number of samples per unit time and
\code{deltat} the time interval between observations (see
\code{\Link{ts}}).
\end{Description}
\begin{Usage}
\begin{verbatim}
time(x, ...)
## Default S3 method:
time(x, offset=0, ...)

cycle(x, ...)
frequency(x, ...)
deltat(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a univariate or multivariate time-series, or a vector or matrix.
\item[\code{offset}] can be used to indicate when sampling took place
in the time unit. \code{0} (the default) indicates the start
of the unit, \code{0.5} the middle and \code{1} the end of
the interval.
\item[\code{...}] extra arguments for future methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These are all generic functions, which will use the
\code{\Link{tsp}} attribute of \code{x} if it exists. \code{time}
and \code{cycle} have methods for class \code{\Link{ts}} that coerce
the result to that class.
\end{Details}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{ts}}, \code{\Link{start}}, \code{\Link{tsp}},
\code{\Link{window}}.

\code{\Link{date}} for clock time, \code{\Link{system.time}}
for CPU usage.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(presidents)
cycle(presidents)
# a simple series plot: c() makes the x and y arguments into vectors
plot(c(time(presidents)), c(presidents), type="l")
\end{ExampleCode}
\end{Examples}

