| Title: | Generate Venn Diagrams with Items Listed in the Sections |
| Version: | 1.1.0 |
| Description: | Generate Venn diagrams from two or three sets, displaying the overlapping items as lists in the appropriate sections. The lists can be split into columns or shortened for large sets and the plot is generated using 'ggplot2' allowing further customisations. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Imports: | ggplot2, ggforce, stringr, scales |
| URL: | https://github.com/microbialman/VennItem |
| BugReports: | https://github.com/microbialman/VennItem/issues |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-01-26 11:07:01 UTC; mjacksonwood |
| Author: | Matthew Jackson-Wood [aut, cre] |
| Maintainer: | Matthew Jackson-Wood <mattjackson4@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-01-26 13:00:24 UTC |
Create Venn Diagram with Items
Description
Draws a 2- or 3-set Venn diagram with items listed in regions.
Usage
vennItem(
sets,
ncol_items = 1,
max_items_per_region = Inf,
fill_alpha = 0.25,
outline_size = 0.8,
palette = NULL,
text_size = 3.5,
font_family = "mono",
title = NULL,
legend = "none",
sort_items = TRUE,
show_set_labels = TRUE,
set_label_size = text_size * 1.5,
set_label_family = font_family,
set_label_nudge = 0.25,
set_label_angles = NULL
)
Arguments
sets |
Named list of character vectors. |
ncol_items |
Number of columns for items drawn within each section. |
max_items_per_region |
Show top n items only. Set to 0 for classic set size Venn. |
fill_alpha |
Fill opacity. |
outline_size |
Circle stroke size. |
palette |
Vector of custom fill colours. |
text_size |
Size of item text. |
font_family |
Font of item text, monospace recommended. |
title |
Plot title. |
legend |
Show fill legend. |
sort_items |
Sort items alphabetically within sections. |
show_set_labels |
Label circles with set names. |
set_label_size |
Size of set names. |
set_label_family |
Font of set names. |
set_label_nudge |
Distance of set names from circle. |
set_label_angles |
Angle of set name from center of plot. |
Value
A ggplot object.
Examples
sets <- list(A = c("apple","banana"), B = c("banana","kiwi"),
C = c("banana","kiwi","apple","pear"))
vennItem(sets)
big_sets <- list(A = c("apple","banana","durian","lychee",
"grapes","pear","melon"),
B = c("banana","kiwi","satsuma","orange","lemon","lime"),
C = c("banana","kiwi","apple","pear","coconut"))
vennItem(big_sets, ncol_items = 2)