compare_three: Compare Three Vectors

Description Usage Arguments Details Value Examples

View source: R/compare-three.R

Description

Convenience function comparing three elements using a desired comparator function.

Usage

1
2
3
4
5
6
7
compare_three(
  x,
  y,
  z,
  compare_fun = "identical",
  result = c("single", "itemized")
)

Arguments

x, y, z

Vectors of equal length to compare

compare_fun

A function used to compare defaults to identical.

result

For single it will return logical scalar TRUE if all arguments are identical; for itemized it will return vector of length equal to lengths of passed arguments. Defaults to single.

Details

The results of the comparator function are tested with

Value

A logical vector of length equal to a, b, c

Examples

1
2
compare_three(1:10, 1:10, 1:10)
compare_three(c("b", "a"), c("b", "b"), c("b", "c"), result = "itemized")

konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.