| checkArray {checkmate} | R Documentation |
Check if an argument is an array
checkArray(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE) check_array(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE) assertArray(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) assert_array(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) testArray(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE) test_array(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE) expect_array(x, mode = NULL, any.missing = TRUE, d = NULL, min.d = NULL, max.d = NULL, null.ok = FALSE, info = NULL, label = vname(x))
x |
[any] |
mode |
[ |
any.missing |
[ |
d |
[ |
min.d |
[ |
max.d |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[character(1)] |
label |
[ |
Depending on the function prefix:
If the check is successful, the functions
assertArray/assert_array return
x invisibly, whereas
checkArray/check_array and
testArray/test_array return
TRUE.
If the check is not successful,
assertArray/assert_array
throws an error message,
testArray/test_array
returns FALSE,
and checkArray returns a string with the error message.
The function expect_array always returns an
expectation.
Other basetypes: checkAtomicVector,
checkAtomic, checkCharacter,
checkComplex, checkDataFrame,
checkDate, checkEnvironment,
checkFactor, checkFunction,
checkIntegerish,
checkInteger, checkList,
checkLogical, checkMatrix,
checkNull, checkNumeric,
checkPOSIXct, checkVector
Other compound: checkDataFrame,
checkDataTable, checkMatrix,
checkTibble
checkArray(array(1:27, dim = c(3, 3, 3)), d = 3)