data_foreign_key: Check key coverage between two tables

Description Usage Arguments See Also Examples

View source: R/data-check.R

Description

Intended to be called from data_check, prints a warning if there are rows in df_foreign with keys that aren't included in df_primary

Usage

1
data_foreign_key(df_foreign, df_primary, key)

Arguments

df_foreign

data frame: table that stores key as foreign

df_primary

data frame: table that stores key as primary

key

character: name of variable that acts as key

See Also

Other functions to check data format: data_check_table, data_check, data_internal, variable_allowed_values

Examples

1
2
3
4
5
6
library(dplyr)
data(sale, cust)
data_foreign_key(sale, cust, "cust_id")

cust <- filter(cust, cust_id > 5)
data_foreign_key(sale, cust, "cust_id")

southwick-associates/salic documentation built on Nov. 5, 2019, 9:13 a.m.