| checkVector | R Documentation |
Check if an argument is a vector
checkVector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE
)
check_vector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE
)
assertVector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE,
.var.name = vname(x),
add = NULL
)
assert_vector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE,
.var.name = vname(x),
add = NULL
)
testVector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE
)
test_vector(
x,
strict = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
names = NULL,
null.ok = FALSE
)
x |
[ |
strict |
[ |
any.missing |
[ |
all.missing |
[ |
len |
[ |
min.len |
[ |
max.len |
[ |
unique |
[ |
names |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
Depending on the function prefix:
If the check is successful, the functions
assertVector/assert_vector return
x invisibly, whereas
checkVector/check_vector and
testVector/test_vector return
TRUE.
If the check is not successful,
assertVector/assert_vector
throws an error message,
testVector/test_vector
returns FALSE,
and checkVector/check_vector
return a string with the error message.
The function expect_vector always returns an
expectation.
Other basetypes:
checkArray(),
checkAtomic(),
checkAtomicVector(),
checkCharacter(),
checkComplex(),
checkDataFrame(),
checkDate(),
checkDouble(),
checkEnvironment(),
checkFactor(),
checkFormula(),
checkFunction(),
checkInteger(),
checkIntegerish(),
checkList(),
checkLogical(),
checkMatrix(),
checkNull(),
checkNumeric(),
checkPOSIXct(),
checkRaw()
Other atomicvector:
checkAtomic(),
checkAtomicVector()
testVector(letters, min.len = 1L, any.missing = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.