Returns a time series with a new start and/or end.
USAGE:
window(x, start=start(x), end=end(x))
REQUIRED ARGUMENTS:
x
univariate or multivariate time series. Missing values (
NAs) are allowed.
OPTIONAL ARGUMENTS:
start
new starting date for the series; if earlier than the starting date
of
x, no change is made.
This can be either a single numeric value, or a length
2 integer vector
giving the period and the position within the period.
If
start falls between two actual sampling times then it takes the value of the
later one.
end
new ending date for the series; if later than the ending date of
x,
no change is made.
This can be either a single numeric value, or a length
2 integer vector
giving the period and the position within the period.
If
end falls between two actual sampling times then it takes the value of the
earlier one.
VALUE:
a univariate or multivariate time series like
x
giving the data between the new
start and
end dates.
SEE ALSO:
,
.
EXAMPLES:
gnp.sub <- window(gnp, c(1970, 1), c(1975, 12))
#subseries of gnp from Jan 1970 through Dec 1975
window(hstart, c(1968, 4), 1973+5/12)