R/are_all_unique.R

Defines functions are_all_unique

Documented in are_all_unique

#' Tests if all elements are unique
#' @param x the elements to be tested
#' @export
are_all_unique <- function(x) {
  testthat::expect_true(length(x) > 0)
  testthat::expect_equal(0, sum(is.na(x)))
  length(x) == length(unique(x))
}
richelbilderbeek/sprentrez documentation built on March 28, 2024, 3:39 a.m.