Created
February 13, 2020 16:35
-
-
Save BenHeubl/de57feb16d8f5fd127df283242d0c1f8 to your computer and use it in GitHub Desktop.
tut16
This file contains 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
#mode function | |
getmode <- function(v) { | |
uniqv <- unique(v) | |
uniqv[which.max(tabulate(match(v, uniqv)))] | |
} | |
incomeR_mode_income <- incomeR %>% | |
group_by(INCOME) %>% | |
summarise(mode = getmode(OCCUPATION)) | |
incomeR_mode_income |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment