| filter_by_percentile | R Documentation |
Select securities in the top or bottom X percentile. More intuitive than filter_top_n when universe size varies.
filter_by_percentile(signal_df, percentile, type = c("top", "bottom"))
signal_df |
DataFrame with signal values |
percentile |
Percentile threshold (0-100) |
type |
"top" for highest signals, "bottom" for lowest |
Binary selection matrix
data("sample_prices_weekly")
momentum <- calc_momentum(sample_prices_weekly, 12)
# Select top 20th percentile
top_20pct <- filter_by_percentile(momentum, 20, type = "top")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.