x[i] x[i, j] x[i, j, drop=T]
"rts"
TRUE
(the default), subscripts of a single row (observation time) or channel
(univariate series) are returned as a vector, if
FALSE the result is
a matrix or data frame.
i and
j.
The result is a time-series only if the indices of time
are in strictly increasing order.
If the indices are not at regular intervals,
the result will be an irregular time series,
i.e. a time series of class
"its".
Assignment is also possible,
but no special methods are necessary for time-series classes.
hstart.rts <- as.rts(hstart)
halfyear.rts <- hstart.rts[seq(1, length(hstart), by=6)]
rain.low <- rts(corn.rain, start=1890,
names="rain")[corn.rain < mean(corn.rain)]
yield.low <- rts(corn.yield, start=1890,
names="yield")[corn.yield < mean(corn.yield)]
ts.intersect(rain.low, yield.low)
votes.rts <- rts(t(votes.repub), start=1856)
southwest <- c("California","Nevada", "Utah",
"New Mexico", "Arizona", "Colorado")
votes.sw <- votes.rts[, southwest]
rts.ex <- rts(rnorm(7))
rts.ex[c(1, 4, 7)]
rts.ex[c(2, 3, 5, 6)]
rts.ex[rev(1:7)]