I have a data table like below:
city year t_20 t_25
Seattle 2019 82 91
Seattle 2018 0 103
NYC 2010 78 8
DC 2011 71 0
DC 2011 0 0
DC 2018 60 0
I would like to group them by city
and year
and count the number of zeros in each group.
How can I do this? by summarize_at
?
df %>% group_by(city, year) %>% summarise_at( WHAT GOES HERE , vars(t_20:t_25))
What should be the first argument of summarize_at
?
or any other way? tally
?