plotVenn: Plots two-sample Euler diagram for the Hodges lab

Description Usage Arguments Examples

View source: R/plotVenn.R

Description

This function accepts four variables from a contingency table mat = [a, b; c, d], and returns an Euler diagram. For non-redundant set1 and set2 and all, the definition of this table is as follows: a = length(intersect(set1,set2)) b = length(setdiff(set1,set2)) c = length(setdiff(set2,set1)) d = length(setdiff(all,union(set1,set2))

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotVenn(
  mat,
  name1 = "",
  name2 = "",
  nametot = "",
  theta = -30,
  col = c("#a3cec6", "#7e74b5", "#8f9d3a"),
  method = "fisher",
  legend.position = "bottom"
)

Arguments

mat

Contingency table as defined above.

name1

Label describing set1 contained by a+b

name2

Label describing set2 contained by a+c

nametot

Label describing all data contained by a+b+c+d

theta

Rotation (in degrees) of the two circles. Defaults to -30.

col

Vector of length 3 describing the three sets: set1, set2, all.

method

Method of calculating odds ratio OR and P value. Default value of "fisher" performs two-sided fisher test and the MLE of the odds ratio. All other values returns one-tailed hypergeometric test and the empirical odds ratio.

legend.position

Position of the legend ("none", "left", "right", "bottom", "top", or two-element numeric vector)

Examples

1
plotVenn(matrix(c(1,2,3,4), ncol=2),"Set 1","Set 2","All data")

hodgeslab/hodgeslabR documentation built on Aug. 6, 2021, 5:10 a.m.