This help topic is for R version 0.64.2. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/time.html
time {base}R Documentation

Sampling Times of Time-Series

Description

time, start, end and frequency are generic functions with a default and a ts method (see methods). tsp(x) returns c(start(x),end(x),frequency(x)).

Usage

time(x, offset=0)
start(x)
end(x)
frequency(x)
tsp(x)
tsp(x) <- value

Arguments

x

a time-series.

Details

time creates the vector of times at which a time series was sampled. offset can be used to indicate when sampling took place in the time unit. 0 indicates the start of the unit, 0.5 the middle and 1 the end of the interval.

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

tsp(x) returns the vector c(start(x),end(x),frequency(x)). It is included for compatibility with the S language. In the assignment form, value must be a numeric of length 3 or NULL which removes the "tsp" attribute and the "ts" class of x.

See Also

ts, window and system.time for CPU usage.

Examples

data(presidents)
# a simple series plot
plot(c(time(presidents)), c(presidents), type="l")

[Package base version 0.64.2 ]