Skip to contents

Extracts the subset of the object x observed between the times start and end (expressed in rata die).

Usage

# S4 method for TimeSeries
window(x, start = NULL, end = NULL)

Arguments

x

A TimeSeries object.

start

A length-one numeric vector specifying the start time of the period of interest.

end

A length-one numeric vector specifying the end time of the period of interest.

Value

A TimeSeries object.

See also

Other time series tools: data.frame, series(), span(), start(), time()

Author

N. Frerebeau

Examples

## Create 3 time-series of 100 observations
## Sampled every years starting from 1000 CE
(x <- series(matrix(rnorm(300), 100, 3), time = 1000:1099, calendar = CE()))
#> 100 x 3 x 1 time series observed between 364878 and 401037 r.d.

## Subset between 1025 and 1050 CE
(y <- window(x, start = 374009, end = 383140))
#> 26 x 3 x 1 time series observed between 374009 and 383140 r.d.