R/extend_with_truth_parameter.R

Defines functions extend_with_truth_parameter

#' @importFrom methods formalArgs
extend_with_truth_parameter <- function(f) {
  if (is.element(".truth", methods::formalArgs(f))) {
    return(f)
  }
  function(x, .truth) f(x)
}

Try the simTool package in your browser

Any scripts or data that you put into this service are public.

simTool documentation built on Jan. 8, 2021, 2:25 a.m.