View source: R/str2str_functions.R
all_diff | R Documentation |
all_diff
tests if all elements are different. The elements could be either
from an atomic vector, list vector, or list. If x
does not have any unique
values (e.g., NULL), then FALSE is returned.
all_diff(x)
x |
atomic vector, list vector, or list. |
The machine precision of all_diff
for numeric vectors is the same as
unique
. This can causes a problem for some floating-point numbers.
logical vector of length 1 specifying whether all the elements in x
are the same (TRUE) or not (FALSE).
all_diff(1:10)
all_diff(c(1:10, 10))
all_diff(c(1.0000000, 1.0000001, 0.9999999)) # machine precision good for most cases
all_diff(1) # works for vectors of length 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.