[ top | up ]

Sampling Times of Time-Series

Syntax

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

Arguments

x a time-series.

Description

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.

See Also

ts.

Examples

# a simple series plot plot(time(x), x, type="l")