earliest.end {tframe}R Documentation

Start and End for Multiple Time Series Objects

Description

Return start or end date (or index of the object) from multiple time series objects.

Usage

    earliest.end(x, ...)
    earliest.end.tframe(x, ...)
    earliest.end.index(x, ...)
    earliest.end.index.tframe(x, ...)
    earliest.end.index.tframe(x, ...)
    earliest.end.index.tframe(x, ...)

    earliest.start(x, ...)
    earliest.start.tframe(x, ...)
    earliest.start.index(x, ...)
    earliest.start.index.tframe(x, ...)
    earliest.start.index.tframe(x, ...)
    earliest.start.index.tframe(x, ...)

    latest.end(x, ...)
    latest.end.tframe(x, ...)
    latest.end.index(x, ...)
    latest.end.index.tframe(x, ...)
    latest.end.index.tframe(x, ...)
    latest.end.index.tframe(x, ...)

    latest.start(x, ...)
    latest.start.tframe(x, ...)
    latest.start.index(x, ...)
    latest.start.index.tframe(x, ...)
    latest.start.index.tframe(x, ...)
    latest.start.index.tframe(x, ...)

Arguments

x A tframe or tframed object.
... Additional tframe or tframed objects.

Details

These functions calculate the start and end of each object in the argument and return a result by comparing across objects. Thus, latest.start returns the start date of the object which starts latest and latest.start.index returns the corresponding index of the object in the argument list.

Value

A date or index.

See Also

tframe tfwindow tftruncate trim.na

Examples

    t1<-ts(c(1,2,3,4,5), start=c(1991,1))
    t2<-ts(c(2,3,4,5,6,7,8), start=c(1992,1))
    t3<-ts(c(NA,2,3,4,5), start=c(1991,1))

    latest.start(t1,t2,t3)  # 1992 1 corresponding to the starting date of 
                            # the object which starts latest (t2)
    latest.start(t1,t3)     # both start in 1991 1 (NAs count as data)
    latest.start(tbind(t1,t2,t3)) # tbind gives a single object starting in 1991 1
    latest.start(t2, tbind(t1,t2,t3))

    latest.start.index(t1,t2,t3)  # position of t2 in the argument list