tsp(x) tsp(x) <- valuestart(x) end(x) frequency(x)
start and end return their times as a pair of numbers: an integer number of time units, and the number of observations times after that integer. For example, for monthly series, with frequency(x) equal to 12, these are year and month.
frequency returns an integer giving the number of observations per unit time.
If s is start(x) and t is tsp(x), then t[1] is the same as s[1]+(s[2]-1)/t[3]. The output for end is analogous.
The tsp function is generic, though it currently has no methods defined for it. This makes the start, end and frequency functions essentially generic since they depend on tsp.
# find the tsp attribute of the ship dataset tsp(ship) # 1967.000 1974.917 12.000 start(ship) # 1967 end(ship) # 1974 12 frequency(ship) # 12# create a time series beginning at same time as ship newdata <- rts(data, start = start(ship), frequency = frequency(ship))