fct_c: Concatenate factors, combining levels

Description Usage Arguments Examples

View source: R/c.R

Description

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

Usage

1
fct_c(fs, ...)

Arguments

fs

A factor, or list of factors.

...

Individual factors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)


forcats documentation built on May 20, 2017, 4:21 a.m.
Search within the forcats package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.