checkFunction(x, args = NULL, ordered = FALSE)assertFunction(x, args = NULL, ordered = FALSE, .var.name)
testFunction(x, args = NULL, ordered = FALSE)
x. Defaults to a heuristic to determine
the name using deparse and substitute.character]
Expected formal arguments. Checks that a function has no arguments if
set to character(0).
Default is NULL (no check).logical(1)]
Flag whether the arguments provided in args must be the first
length(args) arguments of the function in the specified order.
Default is FALSE.TRUE.
If the check is not successful, assertFunction throws an error message,
testFunction returns FALSE and checkFunction returns
a string with the error message.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, testVectortestFunction(mean)
testFunction(mean, args = "x")Run the code above in your browser using DataLab