aggregate_xts_matrix: Aggregate xts matrix data to the given time granularity

Description Usage Arguments Value

Description

Aggregate xts matrix data to the given time granularity

Usage

1
2
aggregate_xts_matrix(data, on, k = 1, FUN = "sum", na_handling = "auto",
  align_data = TRUE, start_date = NULL, end_date = NULL, ...)

Arguments

data

Input xts object.

on

Determines the new unit of the data frequency. Can be "minutes", "hours", or "days".

k

The new value of frequency (only for hours and minutes).

FUN

Function to aggregate the data with. Either a closure (function), or a string. Strings currently supported are "sum", "prod", "min", "max", last", and "first". By default sum is used.

na_handling

What to do with NA's. "auto" fills 0 if FUN == sum, na.locf's last value else. NULL does nothin to NAs. If a function is given, it is applied directly.

align_data

Align data to the next truncated time-stamp

start_date

First Date in the regular series. Calculated from the given series if NULL. Its type must match the type of data's index.

end_date

Last Date in the regular series. Calculated from the given series if NULL. Its type must match the type of data's index.

...

Other parameters given to FUN

Value

Aggregated Time-series


fnoorian/mltsp documentation built on May 16, 2019, 1:48 p.m.