Assertions to Check Types of Variables

A set of predicates and assertions for checking the types of variables. This is mainly for use by other package developers who want to include run-time testing features in their own packages. End-users will usually want to use assertive directly.

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Is the package on CRAN? SemaphoreCI Build Status AppVeyor Build Status

A set of predicates and assertions for checking the types of variables. Most of the documentation is on the assertive page. End-users will usually want to use assertive directly.


To install the stable version, type:


To install the development version, you first need the devtools package.


Then you can install the assertive.types package using



All the predicates in this package check for objects of specific types.

Wrappers to functions in base:

is_array, is_call, is_character, is_complex, is_data.frame, is_environment, is_expression, is_factor, is_function, is_integer, is_language, is_list, is_logical, is_matrix, is_name/is_symbol, is_numeric, is_ordered, is_primitive, is_qr, is_raw, is_s4, and is_table.

Wrappers to functions in grDevices:


Wrappers to functions in methods:


Wrappers to functions in stats:

is_leaf, is_mts, is_stepfun, is_ts, is_tskernel.

Wrappers to functions in utils:



Predicates that return a vector have two corresponding assertions. For example, is_class has assert_all_are_classes and assert_any_are_classes.

Predicates returning a single logical value have one corresponding assertion. For example, is_array has assert_is_array.


0.0-3 Added is_externalptr. Added is_pairlist. Added many function-related assertions (is_closure_function, is_s3_generic, etc.). 0.0-2 Added is_formula and variants. Added is_double and assertions. Some better error messages. 0.0-1 Content extracted from assertive 0.3-0, and tidied.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.