Learn R Programming

gdata (version 2.3.1)

c.factor: Combine factors, properly handling levels

Description

This method for c combines factors while properly preserves level information.

Usage

c.factor(..., recursive = FALSE)

Arguments

...
factors to be combined
recursive
ignored

Value

  • A single factor object. The levels on the new object are created by concatinating the levels of the provided factors, with any duplicate level names merged, and with the factor coding modified appropriately.

See Also

c

Examples

Run this code
f1 <- factor(letters[1:10])
f2 <- factor(letters[5:14])

c(f1,f2)

Run the code above in your browser using DataLab