-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use tabyl with group_by? #200
Comments
Hi! If you want to group by one variable and count another, you simply do a two-way tabyl:
Then calculate your percentages etc. with In terms of the numbers you get, I think you can produce the same #s from a 1-way tabyl in this 2-way tabyl. I'd say this is the "janitor-ish" solution. But if you preferred the style of a list of 1-way tabyls, you could try:
I gather there are more tidyverse-oriented alternatives to split, say nesting from |
Hi, very interesting indeed. No I do now want to use a double sort here because I have quite a bit of different groups (so as you correctly guess I need to keep a long format here). The |
Hello @sfirke,
Thanks for this very nice package.
I am confused as to whether
tabyl
can be used with agroup_by
.Here is the common usage:
group_by
some variable and print the output oftabyl(myvar)
for each group.I was surprisingly unable to do so with a naive
group_by(mygroup) %>% tabyl(myvar)
Can I do that with tabyl? is it meant to be used with grouping?
Thanks!
The text was updated successfully, but these errors were encountered: