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

View source: R/error-checks.R

hasOnlyDistinctValuesR Documentation

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

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)

ospsuite.utils documentation built on March 18, 2022, 6:44 p.m.