overlap: Determine counts of setdiff, intersect, & union of 2 vectors...

overlapR Documentation

Determine counts of setdiff, intersect, & union of 2 vectors (or data.tables)

Description

The output is printed text of intersect, each-way setdiff, and union. Data.table compatible! Just make sure to provide sel_col_x and/or sel_col_y

Usage

overlap(
  x,
  y,
  sel_col_x = NULL,
  sel_col_y = NULL,
  to_return = c("counts", "diff_x", "diff_y", "diff_fuzzy"),
  diff = c(NA, "x", "y", "int", "union", "fuzzy")
)

Arguments

x

vector1 or data.table. If data.table, sel_col_x must not be NULL

y

vector2 or data.table. If data.table, sel_col_y must not be NULL

sel_col_x

If x = data.table, which column to assess?

sel_col_y

If y = data.table, which column to assess?

to_return

(depreciated) "counts" = print overlap counts; "diff_x-or-y" = return setdiff; "diff_fuzzy" = return closest matches for those that differ (ordered best to worst)

diff

Alternative to "to_return". "x" or "y" = return setdiff; "int" = intersect, "union" = union


leylabmpi/LeyLabRMisc documentation built on Nov. 3, 2022, 3:45 p.m.