isTRUE: Backport of isTRUE for R < 3.5.0

Description Usage Examples

View source: R/isTRUE.R

Description

The implementation of 'isTRUE' has been changed in R-3.5.0 from identical(x, TRUE) to is.logical(x) && length(x) == 1L && !is.na(x) && x. This backport overloads the old implementation for R versions prior to 3.5.0.

Usage

1
isTRUE(x)

Examples

1
2
3
4
5
6
# get function from namespace instead of possibly getting
# implementation shipped with recent R versions:
bp_isTRUE = getFromNamespace("isTRUE", "backports")

bp_isTRUE(FALSE)
bp_isTRUE(iris)

backports documentation built on Dec. 13, 2021, 5:08 p.m.