Description Usage Arguments Value References See Also Examples
Checks to see if the input is an internal function. That is, it is a
non-primitive function that calls C-code via .Internal
.
1 2 3 4 | assert_is_internal_function(x, severity = getOption("assertive.severity",
"stop"))
is_internal_function(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_internal_function
returns TRUE
when the input is a
closure function that calls .Internal
. The
assert_*
function returns nothing but throw an error if the
corresponding is_*
function returns FALSE
.
This function is modeled upon is_internal
, internal to the
pryr
package.
The differences between the .Internal
and .Primitive
interfaces
to C code are discussed in R-Internals, in the chapter Internal vs. Primitive.
https://cran.r-project.org/doc/manuals/r-devel/R-ints.html#g_t_002eInternal-vs-_002ePrimitive
is.function
and its assertive wrapper
is_function
.
1 2 3 4 5 6 7 8 9 10 | # Some common fns calling .Internal
is_internal_function(unlist)
is_internal_function(cbind)
# Some failures
assertive.base::dont_stop({
assert_is_internal_function("unlist")
assert_is_internal_function(sqrt)
assert_is_internal_function(function(){})
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.