Created
November 2, 2021 17:01
-
-
Save ayoskovich/b68293e1ce31b76f7ff5a760e65f43f6 to your computer and use it in GitHub Desktop.
Create dataframe of value counts of all variables in select statement.
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
df %>% | |
select( | |
colA, | |
colB, | |
colC | |
) %>% | |
mutate_all(~as.character(.x)) %>% | |
map_df( | |
~count(data.frame(x=.x), x), | |
.id="var" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment