are_all_equal | R Documentation |
Are all the elements of a numeric vector (approximately) equal?
are_all_equal(x, na.rm = FALSE)
x |
A numeric vector. |
na.rm |
Remove missing values (FALSE by default; NAs in x will return NA). |
Logical, whether all elements of a numeric vector are equal.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.