isTRUE
Test for the Value TRUE or FALSE

Description

Tests for a logical object of length one with the value TRUE or FALSE

Usage

isTRUE(x)

Arguments

x Any value.

Details

isTRUE is handy for testing the results of functions like all.equal() and getOption(), which can return TRUE on success and character strings or NULL on failure.
Value
isTRUE(x)returns TRUE if x is a logical vector of length one whose value is TRUE. Otherwise it returns FALSE.
isFALSE(x)returns TRUE if x is a logical vector of length one whose value is FALSE. Otherwise it returns FALSE.
Attributes of x, such as names or dimensions, are ignored.
See Also
all.equal,identical
Examples
isTRUE(all.equal(sqrt(14), sqrt(2)*sqrt(7))) &&
    isTRUE(all.equal(1:2,1:3)) # FALSE
isTRUE( 2 == NaN ) # FALSE

# FALSE if this option not set or FALSE isTRUE(getOption("unusualOption")) options(unusualOption = TRUE) isTRUE(getOption("unusualOption")) # TRUE options(unusualOption = FALSE) isFALSE(getOption("unusualOption")) # TRUE

isTRUE(c(Value=TRUE))

Package base version 6.1.4-13
Package Index