R/make_payout.R

Defines functions make_payout Mode

Documented in make_payout

#' Create payout grid using target threshold
#'
#' @param threshold
#' @param target_payout
#'
#' @return
#' @export
#'
#' @examples
make_payout <- function(n, target_payout, first_payment=0) {
  step = target_payout / (n - 1)
  return(seq(first_payment, by = step, length.out = n))
}

Mode <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}
multiphrenic/IncentiveAnalysis documentation built on May 23, 2019, 8:22 a.m.