R/metric_units.R

Defines functions metric_units

Documented in metric_units

#' Get Units for Performance Metric
#'
#' Mainly a helper function.
#'
#'
#' @param metric Character string.
#'
#'
#' @return
#' Character string.
#'
#'
#' @export
metric_units <- function(metric) {
  ifelse(metric %in% c("cagr", "mdd", "mean", "sd", "allocation") | grepl("growth|alpha", metric), "%", "")
}
vandomed/stocks documentation built on July 22, 2020, 3:25 a.m.