get_mode {manymodelr} | R Documentation |
A convenience function that returns the mode
Description
A convenience function that returns the mode
Usage
get_mode(x, na.rm = TRUE)
Arguments
x |
The dataframe or vector for which the mode is required. |
na.rm |
Logical. Should 'NA's be dropped? Defaults to 'TRUE' |
Details
Useful when used together with get_stats in a pipe fashion. These functions are for exploratory data analysis The smallest number is returned if there is a tie in values The function is currently slow for greater than 300,000 rows. It may take up to a minute. may work with inaccuracies. By default, NAs are discarded.
Value
a data.frame or vector showing the mode of the variable(s)
Examples
test<-c(1,2,3,3,3,3,4,5)
test2<-c(455,7878,908981,NA,456,455,7878,7878,NA)
get_mode(test)
get_mode(test2)
## Not run:
mtcars %>%
get_data_Stats(get_mode)
get_data_Stats(mtcars,get_mode)
## End(Not run)
[Package manymodelr version 0.3.7 Index]