| is_not_false | R Documentation |
FALSE?Sometimes you need to know whether or not an object exists and is not set to
FALSE (and possibly not
NULL).
is_not_false(x, null_is_false = TRUE, ...)
x |
The object to be tested. |
null_is_false |
Should |
... |
Parameters passed to |
TRUE if the object is set to something
different than FALSE,
FALSE
otherwise.
Other logical helpers:
get_run_r_tests(),
is_batch(),
is_cran(),
is_false(),
is_force(),
is_installed(),
is_null_or_true(),
is_of_length_zero(),
is_r_cmd_check(),
is_r_package_installed(),
is_running_on_fvafrcu_machines(),
is_running_on_gitlab_com(),
is_success(),
is_version_sufficient(),
is_windows()
a <- 1
b <- FALSE
c <- NULL
is_not_false(a)
is_not_false(b)
is_not_false(c)
is_not_false(c, null_is_false = FALSE)
is_not_false(not_defined)
f <- function() {
print(a)
print(is_not_false(a))
}
f()
f <- function() {
a <- FALSE
print(a)
print(is_not_false(a))
}
f()
f <- function() {
print(a)
print(is_not_false(a, null_is_false = TRUE,
inherits = FALSE))
}
f()
### We use this to check whether an option is set to something
### different than FALSE:
# Make sure an option is not set:
set_options("test" = NULL, package = "fritools2")
tmp <- get_options("test")
is_not_false(tmp)
is_not_false(tmp, null_is_false = FALSE)
# Does not work on the option directly as it is not an object defined:
options("foo" = NULL)
is_not_false(getOption("foo"), null_is_false = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.