ft_intersect {fctutils} | R Documentation |
Get Intersection of Factor Levels from Multiple Vectors
Description
Combines multiple factor vectors and returns a factor vector containing only the levels common to all.
Usage
ft_intersect(...)
Arguments
... |
Factor vectors to be intersected. |
Value
A factor vector containing the intersection of levels from all provided factors.
Author(s)
Kai Guo
Examples
# Example factor vectors
factor_vec1 <- factor(c('apple', 'banana', 'cherry'))
factor_vec2 <- factor(c('banana', 'date', 'cherry'))
factor_vec3 <- factor(c('banana', 'cherry', 'fig'))
# Get intersection of levels
ft_intersect(factor_vec1, factor_vec2, factor_vec3)
[Package fctutils version 0.0.7 Index]