Learn R Programming

fame (version 1.03)

window.tis: Time windows for Time Indexed Series

Description

window.tis extracts the subset of the object x observed between the times start and end.

Usage

## S3 method for class 'tis':
window(x, start = NULL, end = NULL, extend = F, ...)

Arguments

x
a tis object
start
the start time of the period of interest.
end
the end time of the period of interest.
extend
logical. If true, the start and end values are allowed to extend the series. If false, attempts to extend the series give a warning and are ignored.
...
other arguments to this function are ignored.

Value

  • A tis object that starts and ends at the given times.

Details

The start and end times can be ti objects, or anything that ti(z, tif = tif, freq = frequency), can turn into a ti object.

Examples

Run this code
z <- tis(1:24, start = c(2001,1), freq = 12)
z2 <- window(z, start = 19991231, extend = TRUE) ## z2 extends back with NA's
window(z, end = end(z) - 3)

Run the code above in your browser using DataLab