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