mode_factor | R Documentation |
This function finds the mode of a categorical variable
mode_factor(x)
x |
a factor |
The mode is the most frequently occuring level of a categorical variable. This function returns the mode of a categorical variable. If there is a tie for the most frequent level, it returns all modes.
Adam Petrie
Introduction to Regression and Modeling
data(EX6.CLICK)
mode_factor(EX6.CLICK$DeviceModel)
#To see how often it appears try sorting a table
sort( table(EX6.CLICK$DeviceModel),decreasing=TRUE )
x <- c( rep(letters[1:4],5), "e", "f" ) #multimodel
mode_factor(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.