show_group_mapping: Map Groups using Sankey

View source: R/show_group_mapping.R

show_group_mappingR Documentation

Map Groups using Sankey

Description

This feature is designed for signature analysis. However, users can also use it in other similar situations.

Usage

show_group_mapping(
  data,
  col_to_flow,
  cols_to_map,
  include_sig = FALSE,
  fill_na = FALSE,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  custom_theme = cowplot::theme_minimal_hgrid()
)

Arguments

data

a data.frame containing signature group and other categorical groups.

col_to_flow

length-1 character showing the column to flow, typically a signature group.

cols_to_map

character vector showing colnames of other groups.

include_sig

default if FALSE, if TRUE, showing signature group.

fill_na

length-1 string to fill NA, default is FALSE.

title

the title.

xlab

label for x axis.

ylab

label for y axis.

custom_theme

theme for plotting, default is cowplot::theme_minimal_hgrid().

Value

a ggplot object

Examples


data <- dplyr::tibble(
  Group1 = rep(LETTERS[1:5], each = 10),
  Group2 = rep(LETTERS[6:15], each = 5),
  zzzz = c(rep("xx", 20), rep("yy", 20), rep(NA, 10))
)
p1 <- show_group_mapping(data, col_to_flow = "Group1", cols_to_map = colnames(data)[-1])
p1

p2 <- show_group_mapping(data,
  col_to_flow = "Group1", cols_to_map = colnames(data)[-1],
  include_sig = TRUE
)
p2


sigminer documentation built on Aug. 21, 2023, 9:08 a.m.