textvenn: Text Venn diagram

textvennR Documentation

Text Venn diagram

Description

Text Venn diagram

Usage

textvenn(
  setlist,
  sets = seq_along(setlist),
  overlap_type = c("concordance", "overlap", "each", "agreement"),
  set_colors = NULL,
  spacing = 5,
  padding = 1,
  inverse_title = TRUE,
  inverse_counts = FALSE,
  color_by_counts = TRUE,
  return_items = TRUE,
  unicode = TRUE,
  big.mark = ",",
  sep = "&",
  blend_preset = "ryb",
  curate_df = NULL,
  verbose = FALSE,
  ...
)

Arguments

setlist

list of item vectors; list of vectors named by item; incidence matrix with values c(0, 1) or c(FALSE, TRUE), or c(-1, 0, 1).

sets

integer vector as index to setlist, used to pull out a subset of the list elements. This subset is useful because the set colors are defined for the full setlist, which allows the subset of colors to be consistent for each set.

set_colors

NULL or character vector that contains R-compatible colors. When set_colors is NULL, categorical colors are defined using colorjam::rainbowJam(). When set_colors is defined, the values are recycled to the total number of sets represented by setlist.

spacing, padding

integer values indicating the character spacing and padding around labels printed to the console output.

inverse_title, inverse_counts

logical indicating whether to inverse the color, when inverse_title=TRUE then each Venn set is printed on colored background, when inverse_title=FALSE, each set is printed with colored text with no background color.

return_items

logical default TRUE, whether to return items in the data.frame in column "items". This argument is passed to signed_overlaps().

unicode

logical passed to curate_venn_labels() indicating whether the directional label can include special Unicode characters.

big.mark

character passed to format() for numeric labels.

blend_preset

character string passed as preset to colorjam::blend_colors() to define the color wheel used during color blending operations.

curate_df

data.frame or NULL passed to curate_venn_labels().

verbose

logical indicating whether to print verbose output.

Details

This function is a very simple method to print a Venn diagram using text, intended to be displayed using mono-spaced font on an R console.

Value

data.frame returned using invisible(), from the output of signed_overlaps().

See Also

Other venndir core: render_venndir(), signed_overlaps(), venn_meme(), venndir()

Examples

setlist <- make_venn_test(n_items=100, do_signed=TRUE)

# two-way Venn by default shows concordance
textvenn(setlist, sets=c(1,2))

# without signed directionality use overlap_type="overlap"
textvenn(setlist, sets=c(1,2), overlap_type="overlap")

# three-way Venn showing each signed directionality
textvenn(setlist, sets=c(1,2,3), overlap_type="each")

# larger number of items
setlist <- make_venn_test(n_items=1000000, sizes=200000, do_signed=TRUE)
# text Venn with directionality
textvenn(setlist, sets=c(1,2,3), "agreement")

# basic text Venn with directionality
textvenn(setlist, sets=c(1,2,3), "each")


jmw86069/venndir documentation built on July 12, 2024, 12:21 a.m.