| assert_is_call {assertive.types} | R Documentation |
Checks to see if the input is a language object.
assert_is_call(x, severity = getOption("assertive.severity", "stop"))
assert_is_expression(x, severity = getOption("assertive.severity", "stop"))
assert_is_language(x, severity = getOption("assertive.severity", "stop"))
assert_is_name(x, severity = getOption("assertive.severity", "stop"))
assert_is_symbol(x, severity = getOption("assertive.severity", "stop"))
is_call(x, .xname = get_name_in_parent(x))
is_expression(x, .xname = get_name_in_parent(x))
is_language(x, .xname = get_name_in_parent(x))
is_name(x, .xname = get_name_in_parent(x))
is_symbol(x, .xname = get_name_in_parent(x))
x |
Input to check. |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
is_call, is_expression, is_language,
is_name and is_symbol wrap the corresponding is.*
functions, providing more information on failure. The assert_*
functions return nothing but throw an error if the corresponding
is_* function returns FALSE.
is_name and is_symbol are different names for
the same function.
is.call, is.expression
is.language and is.name.
a_call <- call("sin", "pi")
assert_is_call(a_call)
assert_is_language(a_call)
an_expression <- expression(sin(pi))
assert_is_expression(an_expression)
assert_is_language(an_expression)
a_name <- as.name("foo")
assert_is_name(a_name)
assert_is_language(a_name)
#These examples should fail.
assertive.base::dont_stop(assert_is_language(function(){}))