Skip to contents

This is an internal helper function to check if two or more vectors have same elements (with their order considered as an option).

Usage

checkVectorEqual(..., ignore_order = TRUE)

Arguments

...

arguments of two or more vectors.

ignore_order

logical scalar to disregard the ordering of elements in input vectors. Default is TRUE.

Value

a logical scalar

Examples

vec1 <- c("cherry", "apple", "banana", "cherry")
vec2 <- c("cherry", "apple", "cherry", "banana")
vec3 <- c("banana", "cherry", "apple", "cherry")

checkVectorEqual(vec1, vec2, vec3, ignore_order = TRUE)  # returns TRUE
#> [1] TRUE
checkVectorEqual(vec1, vec2, vec3, ignore_order = FALSE)  # returns FALSE
#> [1] FALSE