This problem is driving me crazy and I can't figure it out. Here is a subset of my dataframe (df) to make things easier.
I want to group_by sex and count the total. Simple?
df %>% group_by(sex) %>% count()
This code returns the following output
What I wanted (and what I thought this code did when I used it before (maybe my memory is bad) was this output
I obtained this output using
df %>% group_by(sex) %>% tally()
I have nothing against tally() but I swear I was using count() before.
Also, I thought I could use group_by %>% summarize(n()) to get the same result, but when I try this code
df %>% group_by(sex) %>% summarize(n())
I get this message
Again, I 'thought' this would work and produce similar output, but it's not. Maybe I'm misremembering things and the least you can do is tell me to get my memory checked :-D
Thanks in advance