is_empty()
checks is an object is empty (any zero-length dimensions).has_length()
checks how long is an object.has_names()
checks if an object is named.has_duplicates()
checks if an object has duplicated elements.has_missing()
andhas_infinite()
check if an object contains missing or infinite values.
Usage
has_length(x, n = NULL)
is_empty(x)
has_names(x, names = NULL)
has_missing(x)
has_infinite(x)
is_unique(x, tolerance = sqrt(.Machine$double.eps), na.rm = FALSE)
has_duplicates(x)
Arguments
- x
A
vector
to be tested.- n
A length-one
numeric
vector specifying the length to testx
with. IfNULL
, returnsTRUE
ifx
has length greater than zero, andFALSE
otherwise.- names
A
character
vector specifying the names to testx
with. IfNULL
, returnsTRUE
ifx
has names, andFALSE
otherwise.- tolerance
A
numeric
scalar giving the tolerance to check within (fornumeric
vector).- na.rm
A
logical
scalar: should missing values (includingNaN
) be omitted?
Value
A logical
scalar.
See also
Other predicates:
is_scalar
,
predicate-matrix
,
predicate-numeric
,
predicate-trend
,
predicate-type