Skip to contents

When a R function is defined in an ordinary fashion (i.e., assigning a function by <- function(...)) would be subject to ambiguity particularly if the function name is the same as the generic function name(s). This function supports detecting classes of arguments in a loosely defined function.

Usage

any_class_args(args = NULL, search = NULL)

Arguments

args

Any list, but preferably generated by list(...) inside a function.

search

character(1). Class name to search. Partial match is supported.

Value

logical vector.

Author

Insang Song

Examples

df <- data.frame(a = 1, b = 3)
any_class_args(list(df), "data.frame")
#> [1] TRUE