
time
creates the vector of times at which a time series was sampled. cycle
gives the positions in the cycle of each observation.
frequency
returns the number of samples per unit time and
deltat
the time interval between observations (see
ts
).
time(x, ...)
## S3 method for class 'default':
time(x, offset = 0, \dots)cycle(x, ...)
frequency(x, ...)
deltat(x, ...)
0
(the default) indicates the start
of the unit, 0.5
the middle and 1
the end of
the interval.tsp
attribute of x
if it exists. time
and cycle
have methods for class ts
that coerce
the result to that class.ts
, start
, tsp
,
window
. date
for clock time, system.time
for CPU usage.
require(graphics)
cycle(presidents)
# a simple series plot
plot(as.vector(time(presidents)), as.vector(presidents), type = "l")
Run the code above in your browser using DataLab