all_the_same | R Documentation |
Tests whether all elements of a simple vector are the same.
all_the_same(x)
x |
A vector or list to test. |
all_the_same(rep(1, 100))
all_the_same(rnorm(100))
all_the_same(letters[rep(1, 10)])
all_the_same(letters[sample(1:10, size = 10)])
all_the_same(list(1:10, 1:10, 1:10))
all_the_same(list(1:10, 1:10, 1:11))
#careful with NAs
all_the_same(c(1, 1, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.