| checkFunction {checkmate} | R Documentation |
Check if an argument is a function
checkFunction(x, args = NULL, ordered = FALSE) assertFunction(x, args = NULL, ordered = FALSE, .var.name) testFunction(x, args = NULL, ordered = FALSE)
x |
[any] |
args |
[ |
ordered |
[ |
.var.name |
[character(1)] |
Depending on the function prefix:
If the check is successful, all functions return TRUE.
If the check is not successful, assertFunction throws an error message,
testFunction returns FALSE and checkFunction returns
a string with the error message.
Other basetypes: assertArray,
checkArray, testArray;
assertAtomicVector,
checkAtomicVector,
testAtomicVector;
assertAtomic, checkAtomic,
testAtomic; assertCharacter,
checkCharacter,
testCharacter; assertComplex,
checkComplex, testComplex;
assertDataFrame,
checkDataFrame,
testDataFrame;
assertEnvironment,
checkEnvironment,
testEnvironment;
assertFactor, checkFactor,
testFactor; assertIntegerish,
checkIntegerish,
testIntegerish;
assertInteger, checkInteger,
testInteger; assertList,
checkList, testList;
assertLogical, checkLogical,
testLogical; assertMatrix,
checkMatrix, testMatrix;
assertNumeric, checkNumeric,
testNumeric; assertVector,
checkVector, testVector
testFunction(mean) testFunction(mean, args = "x")