Learn R Programming

assertive.types

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.

Installation

To install the stable version, type:

install.packages("assertive.types")

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

install.packages("devtools")

Then you can install the assertive.types package using

library(devtools)
install_bitbucket("richierocks/assertive.types")

Predicates

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:

is_raster.

Wrappers to functions in methods:

is_class.

Wrappers to functions in stats:

is_leaf, is_mts, is_stepfun, is_ts, is_tskernel.

Wrappers to functions in utils:

is_relistable.

Assertions

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.

Copy Link

Version

Install

install.packages('assertive.types')

Monthly Downloads

125

Version

0.0-3

License

GPL (>= 3)

Maintainer

Last Published

December 30th, 2016

Functions in assertive.types (0.0-3)

assert_is_array

Is the input an array or matrix?
assert_is_a_string

Is the input of type character?
assert_is_data.frame

Is the input is a data.frame?
assert_is_closure_function

Is the input a closure, builtin or special function?
assert_is_a_complex

Is the input complex?
assert_is_environment

Is the input an environment?
assert_is_data.table

Is the input a data.table?
assert_all_are_classes

Is the input the name of a (formally defined) class?
assert_is_all_of

Does x belong to these classes?
assert_is_date

Is the input a date?
assert_is_formula

Is the input a formula?
assert_is_function

Is the input a function?
assert_is_leaf

Is the input a (dendrogram) leaf?
assert_is_list

Is the input a list?
assert_is_internal_function

Is the input an internal function?
assert_is_factor

Is the input a factor?
assert_is_externalptr

Is the input is an external pointer?
assert_is_call

Is the input a language object?
assert_is_inherited_from

Does the object inherit from some class?
assert_is_an_integer

Is the input an integer?
assert_is_a_bool

Is the input logical?
assert_is_try_error

Is the input a condition?
assert_is_mts

Is the input a time series?
assert_is_a_double

Is the input numeric?
assert_is_tbl

Is the input a tbl?
assert_is_table

Is the input a table?
assert_is_S4

Is the input an S4 object?
assert_is_s3_generic

Is the input an S3 generic or method?
assert_is_a_raw

Is the input raw?
assert_is_relistable

Is the input relistable?
assert_is_raster

Is the input a raster?
assert_is_qr

Is the input a QR decomposition of a matrix?