uniqueness: Does an atomic object only contain unique values?

View source: R/uniqueness.R

uniquenessR Documentation

Does an atomic object only contain unique values?

Description

Evaluates whether x contains only only unique atomic values, with options for for atomizing before evaluation and for handling NA values.

Usage

uniqueness()

is_unique(x, a = FALSE, na = FALSE)

is_unique0(...)

not_unique(x, a = FALSE, na = FALSE)

not_unique0(...)

is_unq(x, a = FALSE, na = FALSE)

is_unq0(...)

not_unq(x, a = FALSE, na = FALSE)

not_unq0(...)

Arguments

x

An atomic object.

a

TRUE or FALSE indicating whether to reduce x to an atomic vector containing all of its atomic values. When FALSE and x is not atomic, throws an error.

na

TRUE or FALSE indicating whether NA values are allowed.

Details

  ⁠not_unique0, not_unq0⁠   whether x is not an atomic vector containing any duplicate value.
   
  ⁠not_unique, not_unq⁠ whether x is not a unique data.frame, list, or vector depending on values of a and na.
   
  ⁠is_unique0, is_unq0⁠ whether x is an atomic vector containing only unique values.
   
  ⁠is_unique, is_unq⁠ whether x is a unique data.frame, list, or vector depending on values of a and na.

Value

A logical scalar.

Functions

  • is_unique(): Evaluate whether x is a unique data.frame, list, or vector depending on values of a and na.

  • is_unique0(): Evaluates whether x is an atomic vector containing only unique values.

  • not_unique(): Evaluates whether x is not a unique data.frame, list, or vector depending on values of a and na.

  • not_unique0(): Evaluates whether x is not an atomic vector containing any duplicate value.

  • is_unq(): An alias for is_unique

  • is_unq0(): An alias for is_unique0

  • not_unq(): An alias for not_unique

  • not_unq0(): An alias for not_unique0

Examples

is_unique(letters)
is_unq(sample(letters, 27, replace = T))

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.