Skip to content
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

Empty sets are counted and are unaffected by 'sets' argument #38

Open
allenbaron opened this issue Jan 6, 2023 · 2 comments
Open

Empty sets are counted and are unaffected by 'sets' argument #38

allenbaron opened this issue Jan 6, 2023 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@allenbaron
Copy link

The first example provided with scale_x_upset() includes counts for empty sets (3rd bar). I'm can't decide whether this is expected or not but I thought it worth noting in case others come across it and are surprised by it.

library(ggupset)
library(ggplot2)

ggplot(tidy_movies[1:100, ], aes(x=Genres)) +
  geom_bar() +
  scale_x_upset(reverse = TRUE, sets=c("Drama", "Action"))
#> Warning: Removed 33 rows containing non-finite values (stat_count).

Created on 2023-01-06 with reprex v2.0.2

@const-ae const-ae added question Further information is requested wontfix This will not be worked on labels Jan 7, 2023
@const-ae
Copy link
Owner

const-ae commented Jan 7, 2023

Hey, thanks for posting this. I agree that this behavior can be surprising but also think that this is the more consistent behavior, so I have no plans to change it .

But I also agree it might be helpful to have it documented in case someone else runs it the behavior, so I will leave this issue open.

Best,
Constantin

@allenbaron
Copy link
Author

I agree that it does make things more consistent. I'm embarrassed to say that I was confused by it 😅. Would you consider documenting it in the manual for scale_x_upset()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants