Skip to contents

Simple predicates

Atomic vectors

is_logical() is_integer() is_double() is_complex() is_character() is_raw() is_atomic() is_numeric()
Type checks - Atomic vectors
are_integer_like() is_integer_like()
Type checks - Integer-like values
are_true() is_true2() are_false() is_false2() is_bool2()
Type checks - TRUE and FALSE values
are_na2() is_na2()
Type checks - NA values
are_finite() is_finite() are_nan() is_nan() are_inf() is_inf()
Type checks - Inf and NaN

Other types

attributes

is_attrs_allowed()
Attribute checks - Check if object allows attributes
has_names_valid() are_names_valid()
Attribute checks - Names
n_dims() n_dimnames() has_dimnames() has_rownames() has_dim()
Attribute checks - Dimensions existence and sizes
attrs_rmv() attrs_keep() has_attrs_any() has_attrs_all() has_attrs_only()
Attribute checks - Check for and filter attributes from object

Object systems

has_object_bit() has_s4_bit() has_class() is_object_like() is_s4() is_object()
Type checks - Objects
object_system() is_system()
Type checks - Determine object-oriented system of object

Data

is_sorted()
Data checks - Check if object is ordered
is_matching_set()
Data checks - Check if object is in (and/or not in) a set
any_duplicated() are_duplicated()
Data checks - Check for duplicate values
is_empty2()
Metadata checks - Check if a collection is empty

Object comparison

Comparison and prototypes

identical2() identical_flag()
Compare - Exact equality with more flexibility
is_ptype() is_ptype_list()
Compare - Check if object is of prototype

If-else and pattern matching

match_hash() match_id() match_ptype() match_when()
Compare - Pattern matching
if_else2()
Compare - Vectorized if-else
case_when2()
Compare - Vectorized nested if-else

Complex predicates and validation

Atomic vectors

Language objects

test_expression() assert_expression()
Validation - Expression vectors
test_symbol() assert_symbol()
Validation - Symbol
test_language() assert_language()
Validation - Language
test_code() assert_code()
Validation - Code Objects

Other types

Attributes

test_names() assert_names()
Validation - Names attribute
test_matrix() assert_matrix()
Validation - Matrix and array attributes
test_class() assert_class()
Validation - Class attribute
test_object() assert_object()
Validation - Object-related attributes

Validation via external functions

assert_from_msg() assert_from_error()
Validation - Rethrow errors with more information
assert_ptype()
Validation - If object is of prototype
assert_predicate()
Validation - Throw error from custom predicate
test_multiple()
Validation - Test for one of multiple types

Utilities

Logical utilities

pany() pall() pany_na() pall_na()
Parallel any and all
reduce_predicate() accumulate_predicate()
Reduce binary predicate over a list

Attributes utilities

attrs_rmv() attrs_keep() has_attrs_any() has_attrs_all() has_attrs_only()
Attribute checks - Check for and filter attributes from object
names3() `names3<-`() dimnames2() `dimnames2<-`() rownames2() `rownames2<-`() class2() `class2<-`()
Attribute utilities - Getters and setters
attr2()
Attribute utilities - Get attribute of object

Others

check_installed2()
Check if user accepted a package installation
c2()
Combine many vectors into one vector