Description Usage Arguments Value Note See Also Examples
Checks to see if the input is a language object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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
.
1 2 3 4 5 6 7 8 9 10 11 | 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(){}))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.