is_not_false {cleanr}R Documentation

Test if an Object is not False

Description

Sometimes you need to know whether or not an object exists and is not set to FALSE (and possibly not NULL).

Usage

is_not_false(object, null_is_false = TRUE, ...)

Arguments

object

The object to be tested.

null_is_false

[boolean(1)]
Should NULL be treated as FALSE?

...

Parameters passed to exists. See Details and Examples.

Details

Pass an environment if you call the function elsewhere than from .GlobalEnv.

Value

TRUE if the object is set to something different than FALSE, FALSE otherwise.

Examples

a  <- 1
is_not_false(a)
f <- function() {
    a <- NULL
    should_be_true <- ! is_not_false(a, null_is_false = TRUE, 
                                      where = environment())
    return(should_be_true)
}
print(f())

[Package cleanr version 1.2.0 Index]