venndir_to_df: Convert venndir output to data.frame

venndir_to_dfR Documentation

Convert venndir output to data.frame

Description

Convert venndir output to data.frame or kable format for visual review.

Usage

venndir_to_df(
  venndir_out,
  df_format = c("hits", "items", "wide"),
  return_type = c("data.frame", "kable"),
  trim_blanks = TRUE,
  wrap_width = 80,
  colorize_headers = TRUE,
  set_colors = NULL,
  item_type = "gene",
  add_counts = TRUE,
  verbose = FALSE,
  ...
)

Arguments

venndir_out

list output from venndir()

return_type

character string indicating how to format output:

  • "kable": returns an object "knitr_kable" suitable for printing as HTML or LaTeX. This output is recommended for RMarkdown documents.

  • "data.frame": returns a data.frame object without colorization.

trim_blanks

logical whether to remove rows with 0 items.

wrap_width

numeric maximum width for item text before it is word-wrapped. To disable word-wrapping use wrap_width=Inf.

colorize_headers

logical indicating whether to color the background of each header by the set_colors.

...

additional arguments are ignored.

Details

Todo:

  • Accept input from signed_overlaps() for purely table summary.

Value

object of class "data.frame" or "knitr_kable" based upon argument return_type.

See Also

Other venndir utility: curate_venn_labels(), expand_range(), make_color_contrast(), make_venn_combn_df(), make_venn_test(), match_list(), nudge_venndir_label(), print_color_df(), shrink_df(), three_point_angle(), venndir_legender()

Examples

setlist <- venndir::make_venn_test(100, 3, do_signed=TRUE);
venndir_out <- venndir::venndir(setlist, overlap_type="each")
df <- venndir_to_df(venndir_out)
head(df, 10)

kdf <- venndir_to_df(venndir_out, return_type="kable")
kdf

df2 <- venndir_to_df(venndir_out, df_format="items")
head(df2, 10)

kdf2 <- venndir_to_df(venndir_out, df_format="items", return_type="kable")
kdf2

df3 <- venndir_to_df(venndir_out, df_format="wide", return_type="data.frame")
df3

kdf3 <- venndir_to_df(venndir_out, df_format="wide", return_type="kable")
kdf3


jmw86069/venndir documentation built on Nov. 14, 2024, 10:12 a.m.