Skip to contents

venndir conversion from signed overlap counts to setlist

Usage

signed_counts2setlist(x, sep = "&", value_sep = "_", ...)

Value

list where the list names are the names of each set, and values of each list element is a vector of items. The items are artificial labels used for convenience.

Details

This function takes input in the form of a list whose names are set overlap labels, for example "set_A", or "set_A&set_B".

Each list element is an integer vector whose names are value overlaps, for example "1", or "-1_1", and whose integer values contain the overlap counts.

See also

Examples

x <- list(
   "set_A"=c(
      "1"=80,
      "-1"=95
   ),
   "set_B"=c(
      "1"=15,
      "-1"=30
   ),
   "set_A&set_B"=c(
      "1_1"=100,
      "-1_-1"=125,
      "1_-1"=3,
      "-1_1"=4
   )
)
setlist <- signed_counts2setlist(x)
# default Venn diagram
vo <- venndir(setlist, overlap_type="each")

# show counts,percent outside, and sign for each item inside
venndir(setlist,
   overlap_type="each",
   show_labels="NCSPi",
   show_items="sign",
   item_degrees=10)


# show counts inside without set label (which is in the legend)
vo <- venndir(setlist,
   show_labels="cs",
   proportional=TRUE,
   label_style="fill_box")


# demonstrate interconversion
setlist2 <- make_venn_test(100, 3, do_signed=TRUE)
vo <- venndir(setlist2, do_plot=FALSE, overlap_type="each")
venndir(signed_counts2setlist(signed_counts(vo)), overlap_type="each")