powered by
Split an index into groups of indexes according to a factor, along either the levels or time periods of the index.
# S3 method for piar_index split(x, f, drop = FALSE, ..., margin = c("levels", "time"))# S3 method for piar_index split(x, f, drop = FALSE, ..., margin = c("levels", "time")) <- value
# S3 method for piar_index split(x, f, drop = FALSE, ..., margin = c("levels", "time")) <- value
split() returns a list of index objects for each level in f. The replacement method replaces these values with the corresponding element of value.
split()
f
value
A price index, as made by, e.g., elemental_index().
elemental_index()
A factor or list of factors to group elements of x.
x
Should levels that do not occur in f be dropped? By default all levels are kept.
Further arguments passed to split.default().
split.default()
Either 'levels' to split over the levels of x (the default), or 'time' to split over the time periods of x.
A list of values compatible with the splitting of x, or something that can be coerced into one, recycled if necessary.
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(), stack.piar_index(), time.piar_index(), window.piar_index()
[.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()
stack.piar_index()
time.piar_index()
window.piar_index()
index <- as_index(matrix(1:6, 2)) split(index, 1:2) split(index, c(1, 1, 2), margin = "time")
Run the code above in your browser using DataLab