| as_selection | R Documentation |
Converts condition matrices or data frames to standard selection format with Date column and binary values. Handles NA by converting to 0.
as_selection(condition_matrix, date_column = NULL)
condition_matrix |
Matrix or data frame with conditions |
date_column |
Optional Date vector if not in input |
Data.table in selection format (Date + binary columns)
data("sample_prices_weekly")
ma20 <- calc_moving_average(sample_prices_weekly, 20)
above_ma <- filter_above(calc_distance(sample_prices_weekly, ma20), 0)
selection <- as_selection(above_ma, sample_prices_weekly$Date)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.