ft_factorize | R Documentation |
Converts one or more character vectors into factors, ensuring that they share the same levels.
ft_factorize(..., levels = NULL)
... |
Character vectors to factorize. |
levels |
An optional character vector specifying the levels. If |
A list of factor vectors with consistent levels.
Kai Guo
# Example character vectors
vec1 <- c('apple', 'banana', 'cherry')
vec2 <- c('banana', 'date', 'apple')
# Factorize with consistent levels
factors <- ft_factorize(vec1, vec2)
levels(factors[[1]])
levels(factors[[2]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.