vec_equal

0th

Percentile

Test if two vectors are equal

Test if two vectors are equal

Usage
vec_equal(x, y, na_equal = FALSE, .ptype = NULL)

vec_equal_na(x)

Arguments
x

Vectors with compatible types and lengths.

y

Vectors with compatible types and lengths.

na_equal

Should NA values be considered equal?

.ptype

Override to optionally specify common type

Value

A logical vector. Will only contain NAs if na_equal is FALSE.

Aliases
  • vec_equal
  • vec_equal_na
Examples
# NOT RUN {
vec_equal(c(TRUE, FALSE, NA), FALSE)
vec_equal(c(TRUE, FALSE, NA), FALSE, na_equal = TRUE)
vec_equal_na(c(TRUE, FALSE, NA))

vec_equal(5, 1:10)
vec_equal("d", letters[1:10])

df <- data.frame(x = c(1, 1, 2, 1), y = c(1, 2, 1, NA))
vec_equal(df, data.frame(x = 1, y = 2))
vec_equal_na(df)
# }
Documentation reproduced from package vctrs, version 0.1.0, License: GPL-3

Community examples

Looks like there are no examples yet.