Minimum and maximum frequencies | R Documentation |
Minimum and maximum frequencies of a vector.
freq.min(x,na.rm = FALSE)
freq.max(x,na.rm = FALSE)
x |
A numerical/integer vector with data but without NAs. |
na.rm |
TRUE or FAlSE for remove NAs if exists. |
Those functions are the same with max(table(x) or min(table(x)) but with one exception. freq.min and freq.max will return also which value has the minimum/maximum frequency. More Efficient than max(table(x) or min(table(x)).
A vector with 2 values, the value with minimum/maximum frequency and the frequency.
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com> and Marios Dimitriadis <kmdimitriadis@gmail.com>.
rowMins, rowMaxs, nth, colrange, colMedians,colSort, rowSort
x <- rnorm(100)
f1 <- freq.min(x)
f2 <- freq.max(x)
# f1r <- min(table(x))
# f2r <- max(table(x))
# f1[2]==f1r ## the frequencies are the same
# f2[2]==f2r ## the frequencies are the same
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.