R: Concatenate factors, combining levels

fct_c {forcats} | R Documentation

## Concatenate factors, combining levels

### Description

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

### Usage

    fct_c(fs, ...)

### Arguments

`fs` | A factor, or list of factors.
`...` | Individual factors

### Examples

    fa <- factor("a")
    fb <- factor("b")
    fab <- factor(c("a", "b"))

    c(fa, fb, fab)
    fct_c(fa, fb, fab)

    # You can also pass a list of factors as the first argument
    fs <- list(fa, fb, fab)
    fct_c(fs)

[Package forcats version 0.2.0 Index]