Test if an Object is Invariant
is_invariant.Rd
Test if an object is invariant (i.e. all values are equal, within a given tolerance for numeric vectors).
Usage
is_invariant(x, ...)
# S3 method for default
is_invariant(x, na.rm = FALSE, ...)
# S3 method for numeric
is_invariant(x, na.rm = FALSE, tol = sqrt(.Machine$double.eps), ...)
# S3 method for list
is_invariant(x, incl_nm = TRUE, ...)
# S3 method for data.frame
is_invariant(x, ...)
Arguments
- x
object to be tested
- ...
unused; for extensibility
- na.rm
logical indicating whether to exclude NA values
- tol
double, tolerance to use (for numeric vectors)
- incl_nm
Whether top-level names should be included in determining if a list is invariant (default:
TRUE
).
See also
Other value predicates:
char_val_predicates
,
num_val_predicates
Other predicates:
char_val_predicates
,
is_curie()
,
lgl_predicates
,
num_val_predicates
,
obo_ID_predicates