ft_intersect | R Documentation |
Combines multiple factor vectors and returns a factor vector containing only the levels common to all.
ft_intersect(...)
... |
Factor vectors to be intersected. |
A factor vector containing the intersection of levels from all provided factors.
Kai Guo
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.