Description Usage Arguments Value See Also Examples
View source: R/is-type-data.table.R
Checks to see if the input is a data.table.
1 2 3 | assert_is_data.table(x, severity = getOption("assertive.severity", "stop"))
is_data.table(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_data.table
wraps is.data.table
, providing more
information on failure. The assert_*
functions return nothing but
throws an error if the corresponding is_*
function returns
FALSE
.
1 2 3 4 5 6 7 8 9 | if(requireNamespace("data.table"))
{
assert_is_data.table(data.table::data.table(x = 1:5))
#These examples should fail.
assertive.base::dont_stop(assert_is_data.table(list(1,2,3)))
} else
{
message("This example requires the data.table package to be installed.")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.