0 votes
1 view
in R Programming by (6.5k 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 (25.3k points)

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 !


Categories

...