compare2vectors: Compare the contents of two vectors

View source: R/generalHelpers.R

compare2vectorsR Documentation

Compare the contents of two vectors

Description

This function takes two vectors and displays how many elements are in one, in the other, or in both as well as which ones are only in one of the two vectors.

Usage

compare2vectors(v1, v2, showInBoth = FALSE)

Arguments

v1

the first vector to compare

v2

the second vector to compare

showInBoth

whether or not to display the values found in both vectors. Default is FALSE

Value

a list containing (1) a data frame with various counts (2) a vector with elements only in the first vector (3) a vector with elements only in the second vector (4) if showInBoth == TRUE, a vector with elements found in both vectors


stuartWagenius/echinaceaLab documentation built on April 13, 2025, 5:22 a.m.