fct_c: Concatenate factors, combining levels

View source: R/c.R

fct_cR Documentation

Concatenate factors, combining levels

Description

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

Usage

fct_c(...)

Arguments

...

<dynamic-dots> Individual factors. Uses tidy dots, so you can splice in a list of factors with ⁠!!!⁠.

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 with !!!
fs <- list(fa, fb, fab)
fct_c(!!!fs)

hadley/forcats documentation built on Nov. 4, 2023, 2:24 a.m.