is_function: Checks if the value is a function

View source: R/functions.R

is_functionR Documentation

Checks if the value is a function

Description

Checks if the value is a function

Usage

is_function(value, num_args = NULL, args = NULL, allow_null = FALSE)

Arguments

value

the value to check

num_args

an integer. If defined, the function must have the exact number of arguments.

args

a vector of strings. If defined, the function must have the exact argument names, in the specified order.

allow_null

if TRUE, allow the value NULL. If FALSE (default) do not allow NULL.

Examples

## Not run: 
# For assertion
assertthat::assert_that(qscheck::is_function(f))
# For check
if (qscheck::is_function(f)) {}

## End(Not run)



AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.