allEqual {tractor.base} | R Documentation |
Test whether all elements of a vector are equal
Description
This function tests whether all elements of the specified vector are equal
to each other, i.e., whether the vector contains only a single unique value.
For lists, equality is determined using equivalent
.
Usage
allEqual(x, ignoreMissing = FALSE, ...)
Arguments
x |
A vector of any mode, including a list. |
ignoreMissing |
If |
... |
Additional arguments to |
Value
TRUE
if all elements test equivalent; FALSE
otherwise.
Author(s)
Jon Clayden
References
Please cite the following reference when using TractoR in your work:
J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. doi:10.18637/jss.v044.i08.
See Also
equivalent
for elementwise equivalence of two
vectors.
Examples
allEqual(c(1,1,1)) # TRUE
allEqual(c(1,1,NA)) # FALSE
allEqual(c(1,1,NA), ignoreMissing=TRUE) # TRUE