Venn Diagram example

Load all the source and libraries

source("http://bioconductor.org/biocLite.R")
## Bioconductor version 2.13 (BiocInstaller 1.12.0), ?biocLite for help
## Upgrade to R-3.0.1 or some packages may not load properly.
biocLite()
## BioC_mirror: http://bioconductor.org
## Using Bioconductor version 2.13 (BiocInstaller 1.12.0), R version 3.0.0.
biocLite("limma")
## BioC_mirror: http://bioconductor.org
## Using Bioconductor version 2.13 (BiocInstaller 1.12.0), R version 3.0.0.
## Installing package(s) 'limma'
## 
## The downloaded source packages are in
##  '/private/var/folders/nn/mky1r73s295cp1qbt_z8pls0ppkbr7/T/RtmpgsQ3Hn/downloaded_packages'
library(limma)

Load the data and create the data structure

hsb2 <- read.csv("http://www.ats.ucla.edu/stat/data/hsb2.csv")
attach(hsb2)
hw <- (write >= 60)
hm <- (math >= 60)
hr <- (read >= 60)
c3 <- cbind(hw, hm, hr)
a <- vennCounts(c3)
a
##   hw hm hr Counts
## 1  0  0  0    113
## 2  0  0  1     18
## 3  0  1  0      8
## 4  0  1  1      8
## 5  1  0  0     12
## 6  1  0  1      8
## 7  1  1  0     11
## 8  1  1  1     22
## attr(,"class")
## [1] "VennCounts"

Plot the Venn diagram


vennDiagram(a)

plot of chunk unnamed-chunk-3