Diff Two Vectors
diff_vecs.RdA convenient diff tool to determine how and where two character vectors differ.
Usage
diff_vecs(x, y, verbose = interactive())Value
An invisible list is returned with the set diffs of each vector. The elements of the list are:
- unique_x:
Entries unique to
x.- unique_y:
Entries unique to
y.- inter:
The intersect
xandy.- unique:
The
union()ofxandy.
Examples
diff_vecs(LETTERS[1:10L], LETTERS[5:15L])
diffs <- diff_vecs(LETTERS[1:10L], LETTERS[5:15L], verbose = FALSE)
diffs
#> $`unique_LETTERS[1:10L]`
#> [1] "A" "B" "C" "D"
#>
#> $`unique_LETTERS[5:15L]`
#> [1] "K" "L" "M" "N" "O"
#>
#> $inter
#> [1] "E" "F" "G" "H" "I" "J"
#>
#> $unique
#> [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O"
#>