is_logical {envnames}R Documentation

Check whether an object contains a valid logical value

Description

Check whether an object contains a valid logical value

Usage

is_logical(x)

Arguments

x

object to check. A scalar is assumed.

Details

This function silently handles special cases for which is.null() and is.na() (called by this function) may return a warning, such as functions objects or environments. (e.g. the warning "Warning message: In is.na(g) : is.na() applied to non-(list or vector) of type 'closure')"

Value

boolean indicating whether the scalar object contains a valid logical value (i.e. TRUE or FALSE) and is not NA nor NULL, and has positive length. FALSE is returned if the object does not exist.


[Package envnames version 0.4.1 Index]