dt_left_outer: Perform left outer join of data.tables with diagnostics

Description Usage Arguments Examples

View source: R/exploratory_functions.R

Description

Given two data.tables, this function performs a left outer join and reports on any cartesian product, what percentage matched up, etc.

Usage

1
dt_left_outer(dt1, dt2, key1, key2 = key1, dt2_subset_cols = NULL, cartesian = T)

Arguments

dt1:

First data.table (the one "on the left")

dt2:

Second data.table (the one "on the right")

key1:

The column (character) from dt1 on which the join is being performed

key2:

The column (character) from dt2 on which the join is being performed

dt2_subset_cols:

Character vector of the columns to keep in dt2 after the join is performed

Examples

1
2
3
first_dt <- data.table (a = 1:5, b = c('a', 'b', 'c', 'd', 'e'))
second_dt <- data.table (a = 3:7, c = c('yes', 'no', 'no', 'yes', 'yes'))
dt_left_outer (first_dt, second_dt, 'a')

zbeaver4/beavR documentation built on May 4, 2019, 9:12 p.m.