ft_unique_comb | R Documentation |
Generates a new factor where each level represents a unique combination of levels from the input factors.
ft_unique_comb(..., sep = "_")
... |
Factor vectors to combine. |
sep |
A string to separate levels in the combined factor. Default is |
A factor vector representing unique combinations.
Kai Guo
# Example factors
factor_vec1 <- factor(c('A', 'A', 'B', 'B'))
factor_vec2 <- factor(c('X', 'Y', 'X', 'Y'))
# Create unique combinations
combined_factor <- ft_unique_comb(factor_vec1, factor_vec2)
levels(combined_factor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.