powered by
Are all the elements of a numeric vector (approximately) equal?
are_all_equal(x, na.rm = FALSE)
Logical, whether all elements of a numeric vector are equal.
A numeric vector.
Remove missing values (FALSE by default; NAs in x will return NA).
are_all_equal(c(5,5,5)) are_all_equal(c(5,5,5,6)) are_all_equal(c(5,5,5,NA,6)) are_all_equal(c(5,5,5,NA,6), na.rm=TRUE) 5==5.000000001 identical(5, 5.000000001) are_all_equal(c(5L, 5, 5.000000001))
Run the code above in your browser using DataLab