Learn R Programming

fctutils (version 0.0.7)

ft_union: Get Union of Factor Levels from Multiple Vectors

Description

Combines multiple factor vectors and returns a factor vector containing all unique levels.

Usage

ft_union(...)

Value

A factor vector containing all unique levels from all provided factors.

Arguments

...

Factor vectors to be united.

Author

Kai Guo

Examples

Run this code
# Example factor vectors
factor_vec1 <- factor(c('apple', 'banana'))
factor_vec2 <- factor(c('banana', 'cherry'))
factor_vec3 <- factor(c('date', 'fig'))

# Get union of levels
ft_union(factor_vec1, factor_vec2, factor_vec3)

Run the code above in your browser using DataLab