R/handles.R

Defines functions handles.format handles.arg

handles.arg <- function(f, a = "data") {
  # determine whether function f handles argument a
  if (!is.function(f)) {
    return(FALSE)
  }
  a %in% names(formals(f))
}


handles.format <- function(fn) {
  # determine whether function fn handles the `format` argument
  f <- get(fn)
  handles.arg(f, "format")
}

Try the mice package in your browser

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

mice documentation built on June 7, 2023, 5:38 p.m.