all_uniquev: Are All Values in a Free-standing Vector Unique?

View source: R/all_uniquev.R

all_uniquevR Documentation

Are All Values in a Free-standing Vector Unique?

Description

For a given vector, does the length of (number of values in) the vector equal the number of unique values in the vector?

Note: all_univ is a compact alias for all_uniquev: they do the same thing, and the former is easier to type

Usage

all_uniquev(x, na.rm = TRUE)

all_univ(x, na.rm = TRUE)

Arguments

x

a vector.

na.rm

a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds.

Value

a 1L logical.

Examples

all_uniquev(mtcars$am) # FALSE

set.seed(35994)
z <- runif(25)
all_univ(z) # TRUE; all_univ is an alias for all_uniquev()

z[c(1, 2)] <- NA # two NA values added
all_univ(z, na.rm = FALSE) # FALSE, because the two NA values are not unique

labelr documentation built on Sept. 11, 2024, 9:05 p.m.