is_logical: Check whether an object contains a valid logical value

Description Usage Arguments Details Value

View source: R/functions.r

Description

Check whether an object contains a valid logical value

Usage

1

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.


envnames documentation built on Dec. 8, 2020, 9:07 a.m.