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 mudfold package in your browser

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

mudfold documentation built on Nov. 24, 2022, 5:09 p.m.