This function returns FALSE if x is NULL, NA, or 0; TRUE if x is a number other than 0 or the text TRUE (case insensitively).

is_TRUE(x)

Arguments

x

The value to check.

Value

TRUE or FALSE

Examples

### These are all FALSE
is_TRUE(NULL);
#> [1] FALSE
is_TRUE(NA);
#> [1] FALSE
is_TRUE(0);
#> [1] FALSE
### These ones are finally TRUE
is_TRUE(2);
#> [1] TRUE
is_TRUE(-2.91);
#> [1] TRUE
is_TRUE("TRUE");
#> [1] TRUE
### And of course
is_TRUE(2 == 2);
#> [1] TRUE
### And
is_TRUE(FALSE == TRUE);
#> [1] FALSE