\HeaderA{time}{Sampling Times of Time Series}{time}
\aliasA{cycle}{time}{cycle}
\aliasA{deltat}{time}{deltat}
\aliasA{frequency}{time}{frequency}
\methaliasA{time.default}{time}{time.default}
\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{\LinkA{ts}{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{\LinkA{tsp}{tsp}} attribute of \code{x} if it exists. \code{time}
and \code{cycle} have methods for class \code{\LinkA{ts}{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{\LinkA{ts}{ts}}, \code{\LinkA{start}{start}}, \code{\LinkA{tsp}{tsp}},
\code{\LinkA{window}{window}}.

\code{\LinkA{date}{date}} for clock time, \code{\LinkA{system.time}{system.time}}
for CPU usage.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
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}

