all_same | R Documentation |
Check if all values in a vector are the same
all_same(xx, na.rm = FALSE, fail_if_na = FALSE, ...)
xx |
A vector |
na.rm |
should NA values be omitted |
fail_if_na |
should function return FALSE when NA values are present |
... |
additional arguments passed to 'base::unique' |
logical value indicating whether all values in the vector were equal
all_same( c(rep(0, 10), NA) ) all_same( c(rep(0, 10), NA), na.rm=TRUE ) all_same( rep(NA, 10) ) all_same( rep(NA, 10), na.rm=TRUE ) all_same( rep(NA, 10), na.rm=FALSE, fail_if_na=TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.