check_dfs_fct_match: Verify that all factor levels in df2 are available in df1

Description Usage Arguments Value See Also Examples

Description

Used to ensure a model trained on df2 can be applied to all examples in df2

Usage

1
check_dfs_fct_match(df1, df2, .silent = FALSE)

Arguments

df1

data.frame with 1+ factor variables

df2

data.frame with 1+ factor variables

Value

invisible. stops runtime if new inference levels are found in df2

See Also

Other checks: check_y

Examples

1
2
3
4
5
6
df2 = gss_cat
df2$race <- as.character(df2$race)
df3 = gss_cat %>% filter(race %in% c("Black", "White"))
check_dfs_fct_match(gss_cat, gss_cat)
try(check_dfs_fct_match(gss_cat, df2))
try(check_dfs_fct_match(gss_cat, df3))

mbadge/hipsMultimodal documentation built on May 9, 2019, 12:05 a.m.