Compose an UpSet plot
upset(
data,
intersect,
base_annotations = "auto",
name = "group",
annotations = list(),
themes = upset_themes,
stripes = upset_stripes(),
labeller = identity,
height_ratio = 0.5,
width_ratio = 0.3,
wrap = FALSE,
set_sizes = upset_set_size(),
mode = "distinct",
queries = list(),
guides = NULL,
encode_sets = TRUE,
matrix = intersection_matrix(),
...
)a dataframe including binary columns representing membership in classes
which columns should be used to compose the intersection
a named list with default annotations (i.e. the intersection size barplot)
the label shown below the intersection matrix
a named list of annotations, each being a list with: list(aes=mapping, geom=geom or list of geoms);
(optional) highlight_geom=list of geoms geoms which can be highlighted with queries,
(optional) top_geom=list of geoms which should show up on top of highlighted queries.
a named list of themes for components and annotations, see upset_default_themes()/upset_modify_themes()
specification of the stripes appearance created with upset_stripes()
function modifying the names of the sets (rows in the matrix)
ratio of the intersection matrix to intersection size height
ratio of the overall set size width to intersection matrix width
whether the plot should be wrapped into a group (makes adding a tile/combining with other plots easier)
the overall set sizes plot, e.g. from upset_set_size() (FALSE to hide)
region selection mode for computing the number of elements in intersection fragment. See get_size_mode() for accepted values.
a list of queries generated with upset_query()
action for legends aggregation and placement ('keep', 'collect', 'over' the set sizes)
whether set names (column in input data) should be encoded as numbers (set to TRUE to overcome R limitations of max 10 kB for variable names for datasets with huge numbers of sets); default TRUE for upset() and FALSE for upset_data().
the intersection matrix plot
Arguments passed on to upset_data
min_sizeminimal number of observations in an intersection for it to be included
max_sizemaximal number of observations in an intersection for it to be included
min_degreeminimal degree of an intersection for it to be included
max_degreemaximal degree of an intersection for it to be included
n_intersectionsthe exact number of the intersections to be displayed; n largest intersections that meet the size and degree criteria will be shown
keep_empty_groupswhether empty sets should be kept (including sets which are only empty after filtering by size)
warn_when_dropping_groupswhether a warning should be issued when empty sets are being removed
warn_when_convertingwhether a warning should be issued when input is not boolean
sort_setswhether to sort the rows in the intersection matrix (descending sort by default); one of: 'ascending', 'descending', FALSE
sort_intersectionswhether to sort the columns in the intersection matrix (descending sort by default); one of: 'ascending', 'descending', FALSE
sort_intersections_bythe mode of sorting, the size of the intersection (cardinality) by default; one of: 'cardinality', 'degree', 'ratio', or any combination of these (e.g. c('degree', 'cardinality'))
sort_ratio_numeratorthe mode for numerator when sorting by ratio
sort_ratio_denominatorthe mode for denominator when sorting by ratio
group_bythe mode of grouping intersections; one of: 'degree', 'sets'
size_columns_suffixsuffix for the columns to store the sizes (adjust if conflicts with your data)
intersectionswhether only the intersections present in data (observed, default), or all intersections (all) should be computed; using all intersections for a high number of sets is not computationally feasible - use min_degree and max_degree to narrow down the selection; this is only useful for modes different from the default exclusive intersection. You can also provide a list with a custom selection of intersections (order is respected when you set sort_intersections=FALSE)
max_combinations_datapoints_na fail-safe limit preventing accidental use of intersections='all' with a high number of sets and observations