R/isVectorized.R

Defines functions isVectorized.smoof_wrapped_function isVectorized.smoof_function isVectorized

Documented in isVectorized

#' Checks whether the given function accept \dQuote{vectorized} input.
#'
#' @template arg_smoof_function
#' @return [\code{logical(1)}]
#' @export
isVectorized = function(fn) {
  UseMethod("isVectorized")
}

#' @export
isVectorized.smoof_function = function(fn) {
  return(attr(fn, "vectorized"))
}

#' @export
isVectorized.smoof_wrapped_function = function(fn) {
  return(isVectorized(getWrappedFunction(fn)))
}

Try the smoof package in your browser

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

smoof documentation built on March 31, 2023, 11:48 p.m.