Description Usage Arguments Value Examples
Check factor levels
1 |
... |
named list where each name is a column name and each value is the expected factor vector |
a check result which passes if each column's levels are equal to the given canonical levels
1 2 3 4 5 6 7 8 | df <- data.frame(
a = as.factor(c("a", "b", "c", "c")),
b = as.factor(c("a", "b", "c", "d"))
)
passer <- check_factor_levels(a = c("a", "b", "c"), b = c("a", "b", "c", "d"))
failer <- check_factor_levels(a = c("a", "b", "c"), b = c("d", "e", "f", "g"))
passer(df)
failer(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.