Learn R Programming

ospsuite.utils (version 1.2.0)

hasOnlyDistinctValues: Check that an array of values does not include any duplicate

Description

Check that an array of values does not include any duplicate

Usage

hasOnlyDistinctValues(values, na.rm = TRUE)

Arguments

values

An array of values

na.rm

Logical to decide if missing values should be removed from the duplicate checking. Note that duplicate NA values are flagged if na.rm=FALSE.

Value

Logical assessing if all values are unique

Examples

Run this code
# NOT RUN {
hasOnlyDistinctValues(c("x", "y"))
hasOnlyDistinctValues(c("x", "y", "x"))
hasOnlyDistinctValues(c("x", NA, "y", NA), na.rm = FALSE)
hasOnlyDistinctValues(c("x", NA, "y", NA), na.rm = TRUE)
# }

Run the code above in your browser using DataLab