type-predicates {rlang}R Documentation

Type predicates

Description

These type predicates aim to make type testing in R more consistent. They are wrappers around base::typeof(), so operate at a level beneath S3/S4 etc.

Usage

is_list(x, n = NULL)

is_atomic(x, n = NULL)

is_vector(x, n = NULL)

is_integer(x, n = NULL)

is_double(x, n = NULL)

is_character(x, n = NULL, encoding = NULL)

is_logical(x, n = NULL)

is_raw(x, n = NULL)

is_bytes(x, n = NULL)

is_null(x)

Arguments

x

Object to be tested.

n

Expected length of a vector.

encoding

Expected encoding of a string or character vector. One of UTF-8, latin1, or unknown.

Details

Compared to base R functions:

See Also

bare-type-predicates scalar-type-predicates


[Package rlang version 0.1.2 Index]