powered by
Creates a list of xts objects split along time periods.
# S3 method for xts split(x, f = "months", drop = FALSE, k = 1, ...)
A list of xts objects.
An xts object.
A character vector describing the period to split by.
Ignored by split.xts().
split.xts()
Number of periods to aggregate into each split. See details.
Further arguments passed to other methods.
Jeffrey A. Ryan
A quick way to break up a large xts object by standard time periods; e.g. 'months', 'quarters', etc.
endpoints() is used to find the start and end of each period (or k-periods). See that function for valid arguments.
endpoints()
The inputs are passed to split.zoo() when f is not a character vector.
split.zoo()
f
endpoints(), split.zoo(), aggregate.zoo()
aggregate.zoo()
data(sample_matrix) x <- as.xts(sample_matrix) split(x) split(x, f="weeks") split(x, f="weeks", k=4)
Run the code above in your browser using DataLab