Skip to contents

This function checks if the specified arguments of a function match the expected type. It is useful for validating function inputs.

Usage

CheckArgs(AllArgs, Args, Type)

Arguments

AllArgs

String. Vector for the input parameters of the function. Usually as a result of formals() function

Args

character vector. Names of the arguments to be checked.

Type

character. Specifies the expected type of the arguments. Must be one of "character", "logical", or "numeric".

Value

The function does not return a value but will stop execution and throw an error if any of the specified arguments do not match the expected type.

Author

Ahmed El-Gabbas