R/apply_rank.R

Defines functions apply_rank

Documented in apply_rank

#' Apply a rank function to an \code{xts} price history.
#' @param x the price history as an \code{xts} object
#' @param rank_fun the ranking function to apply
#' @param ... any parameters passed to the rank function
#' @return the result of the given rank function
#' @seealso ave_3ROC, weight_ave_3ROC, strength_ROC
#' @examples
#' \dontrun{
#' library(quantmod)
#' getSymbols(XLE,auto.assign=TRUE)
#' rv <- apply_rank(XLE,ave_3ROC)
#' head(rv)
#' }
apply_rank <- function(x, rank_fun, ...) {
  FUN <- match.fun(rank_fun)
  FUN(x, ...)
}
greatgray/scorecard documentation built on May 17, 2019, 8:34 a.m.