powered by
Returns a vector indicating the order in which factor levels appear in the data.
ft_level_order(factor_vec)
A numeric vector representing the order of levels.
A factor vector.
Kai Guo
# Example factor vector factor_vec <- factor(c('banana', 'apple', 'cherry', 'apple', 'banana')) # Get level order ft_level_order(factor_vec)
Run the code above in your browser using DataLab