I want to be able to summarise multiple columns separately and have a separate dataframe output for each summary. Right now, I'm doing it manually:
Example:
manufacturer = mpg %>%
select(manufacturer) %>%
group_by(manufacturer) %>%
summarise(
count = n()
)
model = mpg %>%
select(model) %>%
group_by(model) %>%
summarise(
count = n()
)
## etc. for each column of mpg.
Is there a way to do this automatically in some kind of a loop? I want the dataframe names to be the column names.