NiceVennDiagram is a wrapper function for gplots::venn. It draws a Venn diagram and returns a data.frame with pattern frequencies and proportions. The patterns are sorted by combinatorically. Cases with any missing set indicators are discarded with an appropriate warning.

NiceVennDiagram(BINARY_SET_INDICATORS, PLOT = T, SORT_BY_FREQ = F)

Arguments

BINARY_SET_INDICATORS

data.frame of binary indicators of class logical or binary numeric 0 / 1

PLOT

= T generate a plot

SORT_BY_FREQ

= F sort patterns by frequency, not combinatorically

Value

a data.frame with pattern frequencies and proportions

Details

NiceVennDiagram

Examples

if (FALSE) { input.df<-data.frame(fever=sample(0:1,200,replace = T, prob = c(.8,.2)), sweat=sample(0:1,200,replace = T, prob = c(.7,.3)), weightloss=sample(0:1,200,replace = T, prob = c(.75,.25)), nightmare=sample(0:1,200,replace = T, prob = c(.6,.4))) input.df[4,4]<-NA # generate warning NiceVennDiagram(input.df, PLOT = F) NiceVennDiagram(input.df, SORT_BY_FREQ = T) }