all_elements_the_same | R Documentation |
Check whether all elements of a list are identical.
all_elements_the_same(list)
list |
(list) The list to check. |
TRUE if all elements are identical, FALSE if not.
#test lists
l_testlist_ok = list(1:3, 1:3, 1:3, 1:3, 1:3, 1:3)
l_testlist_bad = list(1:3, 1:3, 1:4, 1:3, 1:3, 1:3)
all_elements_the_same(l_testlist_ok) #TRUE
all_elements_the_same(l_testlist_bad) #FALSE
all_elements_the_same(list()) #TRUE if list is empty
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.