R/helper_runner_dps.R

Defines functions helper_runner_dps

Documented in helper_runner_dps

#' Helper Runner DPS
#'
#' Helper function for plot_date_runner function. Calculates digit preference
#' scores and feeds them into the runner::runner function.
#'
#' @param x A numeric vector
#'
#' @return A vector of digit preference scores
#' @export
#'
#' @examples
#' \dontrun{helper_runner_dps(muac)}
helper_runner_dps <- function(x) {

  x <- as.numeric(format(round(x, 1), nsmall = 1))

  vect <- nipnTK::digitPreference(x/10)[1]

  return(vect)


}
SaeedR1987/healthyr documentation built on July 4, 2023, 11:17 p.m.