When is it appropriate to use mode()?

The mode is the least used of the measures of central tendency and can only be used when dealing with nominal data. For this reason, the mode will be the best measure of central tendency (as it is the only one appropriate to use) when dealing with nominal data.
Another time when we usually prefer the median over the mean (or mode) is when our data is skewed (i.e., the frequency distribution for our data is skewed). … Moreover, they all represent the most typical value in the data set.

By default, mode() gets or sets the storage mode of an object. It’s default usage is equivalent to storage.mode(). A sample usage:

x <- 1:25 mode(x) [1] "numeric" y <- "helloWorld" mode(y) [1] "character" mode(state.name) [1] "character"

In the first line, we assign x to values 1 through 25, so when we run it through mode, we get “numeric” because the variable stores numeric values. If we, instead, assign the variable to a string such as in the y variable above, we get “character” as the mode. You can try this out with predefined data sets as well, such as with state.name.