checkArgument
is a utility function that provides basic assurances
about function argument values and generates standardised error messages when
invalid values are encountered.
checkArgument(
argumentCheckMode,
checkDataTypes,
className,
methodName,
argumentValue,
isMissing,
allowMissing = FALSE,
allowNull = FALSE,
allowedClasses = NULL,
mustBeAtomic = FALSE,
allowedListElementClasses = NULL,
listElementsMustBeAtomic = FALSE,
allowedValues = NULL,
minValue = NULL,
maxValue = NULL,
maxLength = NULL
)
A number between 0 and 4 specifying the checks to perform.
A logical value specifying whether the data types should be checked when argumentCheckMode=3
The name of the calling class, for inclusion in error messages.
The name of the calling method, for inclusion in error messages.
The value to check.
Whether the argument is missing in the calling function.
Whether missing values are permitted.
Whether null values are permitted.
The names of the allowed classes for argumentValue.
Whether the argument value must be atomic.
For argument values that are lists(), the names of the allowed classes for the elements in the list.
For argument values that are lists(), whether the list elements must be atomic.
For argument values that must be one value from a set list, the list of allowed values.
For numerical values, the lowest allowed value.
For numerical values, the highest allowed value.
For character values, the maximum allowed length (in characters) of the value.
No return value. If invalid values are encountered, the
stop()
function is used to interrupt execution.