
Detect the input data format for Venn diagram processing
Source:R/venndiagram.R
detect_venn_datatype.RdExamines the structure of data and determines which of the four
supported formats it conforms to:
"long"— a data frame with one row per element-set pair."wide"— a data frame with logical/0-1 columns per set."list"— a named list of element vectors per set."venn"— a pre-computedVennPlotDataobject.
Arguments
- data
A data frame, a named list, or a
VennPlotDataobject. Data frames are classified as"long"when a single non-NULLgroup_byis provided, or"wide"whengroup_byhas two or more columns or isNULL.- group_by
A character string specifying the column name(s) identifying the set membership. A single non-
NULLcolumn indicates long format. Two or more columns, orNULL, indicate wide format.- id_by
A character string specifying the column name that identifies individual elements. Required when
group_byis a single column anddatais a data frame. Ignored for other input types.