#' Check Whether All Elements of a Vector Are Unique
#'
#' Returns a boolean value indicating whether all values of a provided vector are unique. Just a simple wrapper function for 'unique()'.
#' @param vector An atomic vector.
#' @keywords duplicate copy same unique
#' @export
#' @examples
#' unique.vec <- 1:10
#' all_unique(unique.vec)
#' [1] TRUE
#'
#' duplicate.vec <- c(unique.vec, 1)
#' all_unique(duplicate.vec)
#' [1] FALSE
all_unique <- function(vector) {
length(vector) == length(unique(vector))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.