Description Usage Arguments Value Examples
Check whether the input is an external pointer. that is, an object of
class ("externalptr"
).
1 2 3 | assert_is_externalptr(x, severity = getOption("assertive.severity", "stop"))
is_externalptr(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_externalptr
wraps is.data.frame
,
providing more information on failure. assert_is_externalptr
returns nothing but throws an error if is_externalptr
returns FALSE
.
1 2 3 4 5 6 7 8 | # The xml2 pkg makes heavy use of external pointers
xptr <- xml2::read_xml("<foo><bar /></foo>")$node
assert_is_externalptr(xptr)
# This should fail
assertive.base::dont_stop({
assert_is_externalptr(NULL)
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.