Skip to contents

[Experimental]

*_not_empty() check if an argument has length greater than zero.

Usage

check_not_empty(x, null_ok = FALSE, .names = deparse(substitute(x)))

test_not_empty(x, null_ok = FALSE, .names = deparse(substitute(x)))

assert_not_empty(x, null_ok = FALSE, .names = deparse(substitute(x)))

Arguments

x

Any R object.

null_ok

(Optional) A logical flag indicating if NULL values are allowed (Default: FALSE).

.names

(Optional) A character vector specifying the names of the objects being tested. This argument is used internally and should not be set by the user.

Examples

test_not_empty(character())
#> [1] FALSE
#> [1] FALSE # Expected

test_not_empty(1)
#> [1] TRUE
#> [1] TRUE # Expected