Skip to contents

Checks if provided object is a Boolean i.e. a length-one logical vector.

Usage

.is_boolean(x)

Arguments

x

an object to check.

Value

a logical value indicating whether provided object is a Boolean.

Examples

is_boolean(TRUE) # [1] TRUE
#> Error in is_boolean(TRUE): could not find function "is_boolean"
# the following will work on most systems, unless you have tweaked global Rprofile
.is_boolean(T) # [1] TRUE
#> Error in .is_boolean(T): could not find function ".is_boolean"
.is_boolean(1) # [1] FALSE
#> Error in .is_boolean(1): could not find function ".is_boolean"