This is useful way of patching together factors from multiple sources that really should have the same levels but don't.

fct_c(fs, ...)



A factor, or list of factors.


Individual factors


fa <- factor("a") fb <- factor("b") fab <- factor(c("a", "b")) c(fa, fb, fab)
#> [1] 1 1 1 2
fct_c(fa, fb, fab)
#> [1] a b a b #> Levels: a b
# You can also pass a list of factors as the first argument fs <- list(fa, fb, fab) fct_c(fs)
#> [1] a b a b #> Levels: a b