ggVennDiagram main parser

ggVennDiagram(
  x,
  category.names = names(x),
  show_intersect = FALSE,
  set_color = "black",
  set_size = NA,
  label = c("both", "count", "percent", "none"),
  label_alpha = 0.5,
  label_geom = c("label", "text"),
  label_color = "black",
  label_size = NA,
  label_percent_digit = 0,
  label_txtWidth = 40,
  edge_lty = "solid",
  edge_size = 1,
  force_upset = FALSE,
  nintersects = 20,
  order.intersect.by = c("size", "name", "none"),
  order.set.by = c("size", "name", "none"),
  relative_height = 3,
  relative_width = 0.3,
  ...
)

Arguments

x

list of items

category.names

default is names(x)

show_intersect

if TRUE the text can be visualized by `plotly`

set_color

color of set labels ("black")

set_size

size of set labels (NA)

label

format of region labels, select one from c("count","percent","both","none")

label_alpha

set 0 to remove the background of region labels

label_geom

layer of region labels, choose from c("label", "text")

label_color

color of region labels ("black")

label_size

size of region labels (NA)

label_percent_digit

number of digits when formatting percent label (0)

label_txtWidth

width of text used in showing intersect members, will be ignored unless show_intersection is TRUE (40)

edge_lty

line type of set edges ("solid")

edge_size

line width of set edges (1)

force_upset

if TRUE, will always produce Upset plot no matter how many sets have (FALSE)

nintersects

number of intersects. If NULL, all intersections will show.

order.intersect.by

'size', 'name', or "none"

order.set.by

'size', 'name', or "none"

relative_height

the relative height of top panel in upset plot

relative_width

the relative width of left panel in upset plot

...

useless

Value

A ggplot object

Details

From version 1.4.4, `ggVennDiagram` will plot a upset plot when the number of sets is more than 7. Besides, user can switch to a upset plot with `upset_plot()` function. Please check the document of this function.

Examples

library(ggVennDiagram)
x = list(A=1:5,B=2:7,C=3:6,D=4:9)
ggVennDiagram(x)  # 4d venn

ggVennDiagram(x[1:3])  # 3d venn

ggVennDiagram(x[1:2])  # 2d venn