Examples for 'checkmate::qassert'


Quick argument checks on (builtin) R types

Aliases: qassert qtest qexpect

Keywords:

### ** Examples

# logical of length 1
qtest(NA, "b1")
[1] TRUE
# logical of length 1, NA not allowed
qtest(NA, "B1")
[1] FALSE
# logical of length 0 or 1, NA not allowed
qtest(TRUE, "B?")
[1] TRUE
# numeric with length > 0
qtest(runif(10), "n+")
[1] TRUE
# integer with length > 0, NAs not allowed, all integers >= 0 and < Inf
qtest(1:3, "I+[0,)")
[1] TRUE
# either an emtpy list or a character vector with <=5 elements
qtest(1, c("l0", "s<=5"))
[1] FALSE
# data frame with at least one column and no missing value in any column
qtest(iris, "D+")
[1] TRUE

[Package checkmate version 2.3.2 Index]