Description Usage Arguments Details Value Author(s) Examples
expand a factor variables in all dataset to encompass levels of all sets
1 2 | expandAllInconsistentFactorLevels(..., .noWarningCols = character(0),
.omitWarning = FALSE)
|
... |
list of data.frames or several data.frames separated by comma |
.noWarningCols |
string vector: do not warn for the these columns |
.omitWarning |
If no data.frame is provided, its returns an empty list.
Instead of providing several arguments, one can provide a a single list of data.frames
datasets
with updated factor columns
Thomas Wutzler
1 2 3 4 5 6 7 8 | if (exists("expandAllInconsistentFactorLevels")) {
df1 <- data.frame(f = factor(c("D","D","C")))
df2 <- data.frame(f = factor(c("C","C","A"))
, desc = c("forC1","forC2","forA1"))
if (requireNamespace("dplyr"))
dplyr::bind_rows(expandAllInconsistentFactorLevels(df1,df2))
left_joinFactors(df1,df2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.