compare_vecs: Pairwise element comparison of two vectors

View source: R/compare.R

compare_vecsR Documentation

Pairwise element comparison of two vectors

Description

Returns a table summarising the ordering of corresponding elements of the two supplied vectors. Inputs can be factors but must be atomic and the same length. If the vectors are of different classes or types then the comparison will depend on coercion.

Usage

compare_vecs(x, y, names = NULL, simple = FALSE, tol = 0.000001, na.rm = FALSE)

Arguments

x, y

The two vectors to be compared. Both vectors must be atomic and of the same length.

names

Optional length 2 string vector of names for the input vectors, to be used in the output table. Otherwise, "x" and "y" are used.

simple

Logical. If TRUE then only checks for pairwise differences, not ordering.

tol

When comparing numeric vectors, equality and inequality comparisons use this tolerance.

na.rm

If TRUE, will ignore indices where either vector is NA. The main reason to use this is if you want to see the proportion of non-missing entries that match/differ.


jedwards24/edwards documentation built on Sept. 2, 2023, 8:16 a.m.