Type checks - Atomic vectors
predicates-atomic.RdCheck if an object is of a specific atomic type (typeof()). The test is
invariant to attributes such as class.
rlang::is_logical(),rlang::is_integer(),rlang::is_double(),rlang::is_complex(),rlang::is_character(), andrlang::is_raw()check if an object is of the respective atomic type.rlang::is_atomic()checks if an object is any of the above.is_numeric()checks if an object is either an integer or double vector.
Usage
is_logical(x, n = NULL)
is_integer(x, n = NULL)
is_double(x, n = NULL, finite = NULL)
is_complex(x, n = NULL, finite = NULL)
is_character(x, n = NULL)
is_raw(x, n = NULL)
is_atomic(x, n = NULL)
is_numeric(x, n = NULL)Arguments
- x
[
any] An object to test.- n
[
integer(1)|NULL] Length ofx, set toNULLto not test.- finite
[
TRUE|FALSE|NULL] Whether all values of the vector are notNA,NaN,Inf, or-Inf. Set toNULLto not test.is_finite()is designed to allow more flexibility to this test.