| prepare_venn_data | R Documentation |
Converts data in any supported input format into a VennPlotData
object suitable for rendering by ggVennDiagram. When
in_form = "auto" (the default), the format is detected via
detect_venn_datatype().
prepare_venn_data(
data,
in_form = "auto",
group_by = NULL,
group_by_sep = "_",
id_by = NULL
)
data |
A data frame, a named list, or a |
in_form |
A character string specifying the input format. One of
|
group_by |
A character string (or vector) specifying the column name(s)
identifying set membership. For long-format data, a single column defines
the set; multiple columns are concatenated with |
group_by_sep |
A character string used to concatenate multiple
|
id_by |
A character string specifying the column name that identifies individual elements. Required for long-format data; ignored otherwise. |
A VennPlotData object suitable for rendering by
ggVennDiagram.
Long format — a data frame with a grouping column
(group_by) identifying the set and an ID column
(id_by) identifying each element. Multiple group_by
columns are concatenated with group_by_sep.
group_by id_by A a1 A a2 B a1 B a3
Wide format — a data frame where each column represents a
set and each row an element. Values must be logical or
0/1. Columns specified in group_by define the
sets; if group_by is NULL, all columns are used.
A B TRUE TRUE TRUE FALSE FALSE TRUE
List format — a named list where each element is a vector of identifiers belonging to that set.
list(A = c("a1", "a2"), B = c("a1", "a3"))
VennPlotData — a pre-computed object returned by a
previous call to prepare_venn_data(). Returned as-is.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.