checkArray {checkmate} | R Documentation |
Check if an argument is an array
Description
Check if an argument is an array
Usage
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)
)
Arguments
x |
[any] |
mode |
[ |
any.missing |
[ |
d |
[ |
min.d |
[ |
max.d |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[ |
label |
[ |
Value
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
/check_array
return a string with the error message.
The function expect_array
always returns an
expectation
.
See Also
Other basetypes:
checkAtomic()
,
checkAtomicVector()
,
checkCharacter()
,
checkComplex()
,
checkDataFrame()
,
checkDate()
,
checkDouble()
,
checkEnvironment()
,
checkFactor()
,
checkFormula()
,
checkFunction()
,
checkInteger()
,
checkIntegerish()
,
checkList()
,
checkLogical()
,
checkMatrix()
,
checkNull()
,
checkNumeric()
,
checkPOSIXct()
,
checkRaw()
,
checkVector()
Other compound:
checkDataFrame()
,
checkDataTable()
,
checkMatrix()
,
checkTibble()
Examples
checkArray(array(1:27, dim = c(3, 3, 3)), d = 3)