% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/upset.R
\name{upset}
\alias{upset}
\title{Compose an UpSet plot}
\usage{
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(),
  ...
)
}
\arguments{
\item{data}{a dataframe including binary columns representing membership in classes}

\item{intersect}{which columns should be used to compose the intersection}

\item{base_annotations}{a named list with default annotations (i.e. the intersection size barplot)}

\item{name}{the label shown below the intersection matrix}

\item{annotations}{a named list of annotations, each being a list with: \verb{list(aes=mapping, geom=geom or list of geoms)};
\itemize{
\item (optional) \verb{highlight_geom=list of geoms} geoms which can be highlighted with queries,
\item (optional) \verb{top_geom=list of geoms} which should show up on top of highlighted queries.
}}

\item{themes}{a named list of themes for components and annotations, see \code{upset_default_themes()}/\code{upset_modify_themes()}}

\item{stripes}{specification of the stripes appearance created with \code{upset_stripes()}}

\item{labeller}{function modifying the names of the sets (rows in the matrix)}

\item{height_ratio}{ratio of the intersection matrix to intersection size height}

\item{width_ratio}{ratio of the overall set size width to intersection matrix width}

\item{wrap}{whether the plot should be wrapped into a group (makes adding a tile/combining with other plots easier)}

\item{set_sizes}{the overall set sizes plot, e.g. from \code{upset_set_size()} (\code{FALSE} to hide)}

\item{mode}{region selection mode for computing the number of elements in intersection fragment. See \code{get_size_mode()} for accepted values.}

\item{queries}{a list of queries generated with \code{upset_query()}}

\item{guides}{action for legends aggregation and placement ('keep', 'collect', 'over' the set sizes)}

\item{encode_sets}{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().}

\item{matrix}{the intersection matrix plot}

\item{...}{
  Arguments passed on to \code{\link[=upset_data]{upset_data}}
  \describe{
    \item{\code{min_size}}{minimal number of observations in an intersection for it to be included}
    \item{\code{max_size}}{maximal number of observations in an intersection for it to be included}
    \item{\code{min_degree}}{minimal degree of an intersection for it to be included}
    \item{\code{max_degree}}{maximal degree of an intersection for it to be included}
    \item{\code{n_intersections}}{the exact number of the intersections to be displayed; n largest intersections that meet the size and degree criteria will be shown}
    \item{\code{keep_empty_groups}}{whether empty sets should be kept (including sets which are only empty after filtering by size)}
    \item{\code{warn_when_dropping_groups}}{whether a warning should be issued when empty sets are being removed}
    \item{\code{warn_when_converting}}{whether a warning should  be issued when input is not boolean}
    \item{\code{sort_sets}}{whether to sort the rows in the intersection matrix (descending sort by default); one of: \code{'ascending'}, \code{'descending'}, \code{FALSE}}
    \item{\code{sort_intersections}}{whether to sort the columns in the intersection matrix (descending sort by default); one of: \code{'ascending'}, \code{'descending'}, \code{FALSE}}
    \item{\code{sort_intersections_by}}{the mode of sorting, the size of the intersection (cardinality) by default; one of: \code{'cardinality'}, \code{'degree'}, \code{'ratio'}, or any combination of these (e.g. \code{c('degree', 'cardinality')})}
    \item{\code{sort_ratio_numerator}}{the mode for numerator when sorting by ratio}
    \item{\code{sort_ratio_denominator}}{the mode for denominator when sorting by ratio}
    \item{\code{group_by}}{the mode of grouping intersections; one of: \code{'degree'}, \code{'sets'}}
    \item{\code{size_columns_suffix}}{suffix for the columns to store the sizes (adjust if conflicts with your data)}
    \item{\code{intersections}}{whether only the intersections present in data (\code{observed}, default), or all intersections (\code{all}) should be computed; using all intersections for a high number of sets is not computationally feasible - use \code{min_degree} and \code{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 \code{sort_intersections=FALSE})}
    \item{\code{max_combinations_datapoints_n}}{a fail-safe limit preventing accidental use of \code{intersections='all'} with a high number of sets and observations}
  }}
}
\description{
Compose an UpSet plot
}
