checkRaw {checkmate} | R Documentation |
Check if an argument is a raw vector
checkRaw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE) check_raw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE) assertRaw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) assert_raw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) testRaw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE) test_raw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE) expect_raw(x, len = NULL, min.len = NULL, max.len = NULL, names = NULL, null.ok = FALSE, info = NULL, label = vname(x))
x |
[any] |
len |
[ |
min.len |
[ |
max.len |
[ |
names |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[character(1)] |
label |
[ |
Depending on the function prefix:
If the check is successful, the functions
assertRaw
/assert_raw
return
x
invisibly, whereas
checkRaw
/check_raw
and
testRaw
/test_raw
return
TRUE
.
If the check is not successful,
assertRaw
/assert_raw
throws an error message,
testRaw
/test_raw
returns FALSE
,
and checkRaw
returns a string with the error message.
The function expect_raw
always returns an
expectation
.
Other basetypes: checkArray
,
checkAtomicVector
,
checkAtomic
, checkCharacter
,
checkComplex
, checkDataFrame
,
checkDate
, checkDouble
,
checkEnvironment
,
checkFactor
, checkFormula
,
checkFunction
,
checkIntegerish
,
checkInteger
, checkList
,
checkLogical
, checkMatrix
,
checkNull
, checkNumeric
,
checkPOSIXct
, checkVector
testRaw(as.raw(2), min.len = 1L)