Check Data Types

assert_type(x, expected)

assert_scalar(x, expected)

Arguments

x

An object to be checked.

expected

A character string specifying the expected type. It must be one of "list", "atomic", "vector", "numeric", "integer", "double", "character" or "logical".

Value

Throws an error, if any, and returns x invisibly otherwise.

See also

Author

N. Frerebeau