Replaces unreadable 4+ way Venn diagrams: a bar chart of intersection sizes above a dot matrix showing which sets each bar belongs to.

geom_upset(mapping = NULL, data = NULL, alpha = NULL, dot_size = NULL)

Arguments

mapping, data

Standard layer overrides. Requires label (the set membership of each observation, e.g. "A&B").

alpha

Bar opacity.

dot_size

Membership-dot radius in px.

Value

A Layer to add with +.

Examples

d <- data.frame(sets = c("A", "A&B", "B", "A&B&C", "C", "A&B", "A"))
ggnext(d, aes(label = sets)) + geom_upset() + theme_void()
#> <ggnext plot>
#>   data:  7 x 1
#>   aes:   label = sets
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static