Learn R Programming

PortfolioTesteR (version 0.1.4)

ml_panel_reduce: Reduce multiple panels with a binary operator

Description

Folds a list of panels using ml_panel_op() across a set of named panels.

Usage

ml_panel_reduce(features, panels, op = `*`, how = "intersect", fill = NA_real_)

Value

A data.frame panel (wide) with the reduced result.

Arguments

features

List of panels (each a wide data frame with Date).

panels

Character vector of names in features to reduce (length \(\ge\) 2).

op

Binary function to apply elementwise.

how

Column-set policy passed to ml_panel_op().

fill

Fill value for how="union".

Examples

Run this code
if (FALSE) {
# product of three panels
prod_panel <- ml_panel_reduce(X, c("mom12","vol","rsi14"), op = `*`)
}

Run the code above in your browser using DataLab