get_mode: A convenience function that returns the mode

Description Usage Arguments Details Value Examples

View source: R/get_mode.R

Description

A convenience function that returns the mode

Usage

1
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

1
2
3
4
5
6
7
8
9
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)

manymodelr documentation built on Nov. 15, 2021, 5:07 p.m.