Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in R Programming by (7.3k points)

In R, mean() and median() are standard functions which do what you'd expect.  mode() tells you the internal storage mode of the object, not the value that occurs the most in its argument. But is there is a standard library function that implements the statistical mode for a vector (or list)?

1 Answer

0 votes
by

There is a package called modeest which enables to compute an estimate of the mode of a univariate distribution. Its dependency genefilter is part of Bioconductor, so it needs to be installed using Bioconductor methods.

For example:

install.packages("modeest")

install.packages("BiocManager")

library("BiocManager")

BiocManager::install("genefilter")

 

 

 To find mode:

mySample <- c(19, 4, 5, 7, 29, 19, 29, 13, 25, 19)

 

library(modeest)

mlv(mySamples, method = "mfv")

[1] 51

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.7k users

Browse Categories

...