Skip to contents

Get N and percent match of values between two columns of two data.tables

Usage

dt_pctmatch(x, y, on = NULL, left_on = NULL, right_on = NULL, verbosity = 1L)

Arguments

x

data.table: First input data.table.

y

data.table: Second input data.table.

on

Integer or character: column to read in x and y, if it is the same

left_on

Integer or character: column to read in x

right_on

Integer or character: column to read in y

verbosity

Integer: Verbosity level.

Value

list.

Author

EDG

Examples

library(data.table)
x <- data.table(ID = 1:5, Alpha = letters[1:5])
y <- data.table(ID = c(3, 4, 5, 6), Beta = LETTERS[3:6])
dt_pctmatch(x, y, on = "ID")
#> 2026-02-22 18:59:25 
#> Matched 3/5 on ID (60.00%)
#>  [dt_pctmatch]