Learn R Programming

assertions (version 0.1.0)

has_no_duplicates: Check if a vector has no duplicates

Description

This function returns a logical value indicating whether the input vector contains no duplicated elements.

Usage

has_no_duplicates(x)

Value

A logical value indicating whether the input vector contains no duplicated elements.

Arguments

x

A vector.

Examples

Run this code
if(interactive()){
has_no_duplicates(c(1, 2, 3))  # returns TRUE
has_no_duplicates(c(1, 2, 2))  # returns FALSE
}

Run the code above in your browser using DataLab