| prepare_upset_data | R Documentation |
Converts raw input (long data frame, wide data frame, named list, or an
existing UpsetPlotData object) into the internal format expected by
UpsetPlotAtomic(). This is the data-preparation workhorse
that handles all input format parsing.
prepare_upset_data(
data,
in_form = "auto",
group_by = NULL,
group_by_sep = "_",
id_by = NULL,
specific = TRUE
)
data |
A data frame, a named list of element vectors, or an
|
in_form |
A character string specifying the input format. One of
|
group_by |
A character vector of column name(s) defining the sets.
In long format, this is the column with set labels. In wide format,
these are the set-membership columns. When |
group_by_sep |
A character string to concatenate multiple
|
id_by |
A character string specifying the column name for instance
identifiers. Required for long format; optional for wide format (a
synthetic |
specific |
A logical value. When |
An UpsetPlotData object — a data frame with an
Intersection list-column of set labels and one row per element.
A "group_order" attribute preserves the original set order.
Long format — one row per (set, element) pair:
group_by id_by A a1 A a2 B a1 B a3
Requires both group_by and id_by.
Wide format — each row is an element, each set has a logical or 0/1 membership column:
A B TRUE TRUE TRUE FALSE FALSE TRUE
The set columns are identified by group_by (or all columns except
id_by when group_by = NULL).
List format — a named list of element vectors:
list(A = c("a1", "a2"), B = c("a1", "a3"))
UpsetPlotData — a pre-processed object (returned by this function)
is returned unchanged (with a warning if group_by is also provided).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.