Creates a comparison level that fires when two column values are transposed between the left and right records (e.g., first name and surname accidentally swapped).
Arguments
- col_name_2
Name of the second column (character). The first column is the one passed to
il_compare().- symmetrical
Logical. If
TRUE, checks both directions:l.col1 = r.col2 AND l.col2 = r.col1. IfFALSE(default), checks one direction only:l.col1 = r.col2.
Value
A comparison-level object for use in il_compare() or
cl_levels().
Details
Use inside cl_levels() to add a swap-detection level to a custom
comparison. For a ready-made name comparison that already includes
swap detection, see cl_forename_surname().
