checkRaw {checkmate} | R Documentation |
Check if an argument is a raw vector
Description
Check if an argument is a raw vector
Usage
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)
)
Arguments
x |
[any] |
len |
[ |
min.len |
[ |
max.len |
[ |
names |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[ |
label |
[ |
Value
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
/check_raw
return a string with the error message.
The function expect_raw
always returns an
expectation
.
See Also
Other basetypes:
checkArray()
,
checkAtomic()
,
checkAtomicVector()
,
checkCharacter()
,
checkComplex()
,
checkDataFrame()
,
checkDate()
,
checkDouble()
,
checkEnvironment()
,
checkFactor()
,
checkFormula()
,
checkFunction()
,
checkInteger()
,
checkIntegerish()
,
checkList()
,
checkLogical()
,
checkMatrix()
,
checkNull()
,
checkNumeric()
,
checkPOSIXct()
,
checkVector()
Examples
testRaw(as.raw(2), min.len = 1L)