ggupset
ggupset copied to clipboard
Empty sets are counted and are unaffected by 'sets' argument
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
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
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()?