type-predicates
From purrr v0.2.2.2
by Lionel Henry
Type predicates
These type predicates aim to make type testing in R more
consistent. They are wrappers around typeof
, so
operate at a level beneath S3/S4 etc.
Usage
is_list(x)is_atomic(x)
is_vector(x)
is_numeric(x)
is_integer(x)
is_double(x)
is_character(x)
is_logical(x)
is_null(x)
is_function(x)
Arguments
- x
object to be tested.
Details
Compare to base R functions:
Unlike
is.atomic()
,is_atomic()
does not returnTRUE
forNULL
.Unlike
is.vector()
,is_vector()
test if an object is an atomic vector or a list.is.vector
checks for the presence of attributes (other than name).is_numeric()
is not generic so, (e.g.) dates and date times areTRUE
, notFALSE
.is_function()
returnsTRUE
only for regular functions, not special or primitive functions.
See Also
Community examples
Looks like there are no examples yet.