View source: R/window.piar_index.R
| window.piar_index | R Documentation |
Extract and replace index values over a window of time periods.
## S3 method for class 'piar_index'
window(x, start = NULL, end = NULL, ...)
## S3 replacement method for class 'piar_index'
window(x, start = NULL, end = NULL, ...) <- value
x |
A price index, as made by, e.g., |
start |
The time period to start the window. The default in the first
period of |
end |
The time period to end the window. The default is the last period
of |
... |
Not currently used. |
value |
A numeric vector or price index. |
window() extracts a price index over a window of time periods that
inherits from the same class as x. The replacement method replaces these
with value.
Other index methods:
[.piar_index(),
aggregate.piar_index,
as.data.frame.piar_index(),
as.ts.piar_index(),
chain(),
contrib(),
head.piar_index(),
is.na.piar_index(),
levels.piar_index(),
mean.piar_index,
merge.piar_index(),
split.piar_index(),
stack.piar_index(),
time.piar_index()
x <- as_index(matrix(1:9, 3))
window(x, "2")
window(x, "2") <- 1
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.