Learn R Programming

assertive.types (version 0.0-3)

assert_is_environment: Is the input an environment?

Description

Checks to see if the input is an environment.

Usage

assert_is_environment(x, severity = getOption("assertive.severity", "stop"))
is_environment(x, .xname = get_name_in_parent(x))

Arguments

x
Input to check.
severity
How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".
.xname
Not intended to be used directly.

Value

is_environment wraps is.environment, providing more information on failure. assert_is_environment returns nothing but throws an error if is_environment returns FALSE.

See Also

is.environment.

Examples

Run this code
assert_is_environment(new.env())
assert_is_environment(globalenv())
assert_is_environment(baseenv())

Run the code above in your browser using DataLab