Created
December 17, 2015 20:11
-
-
Save atbradley/97741e93d7ba57d482c7 to your computer and use it in GitHub Desktop.
Function to return the statistical mode in R.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smode <- function(x) { | |
which(tabulate(x)==max(tabulate(x))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment