| Title: | Generate Venn Diagrams with Items Listed in the Sections |
| Version: | 1.0.0 |
| Description: | Generate Venn diagrams with the items listed in appropriate sections, supporting multiple columns for long lists. |
| 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-13 17:28:30 UTC; mjacksonwood |
| Author: | Matthew Jackson-Wood [aut, cre] |
| Maintainer: | Matthew Jackson-Wood <mattjackson4@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-01-19 17:50:12 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. |
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)