plot_meta_sankey: Plot metadata factors as a sankey diagram.

View source: R/plot_misc.R

plot_meta_sankeyR Documentation

Plot metadata factors as a sankey diagram.

Description

This provides two implementations of a sankey plot, one interactive and one using ggplot2.

Usage

plot_meta_sankey(
  design,
  factors = c("condition", "batch"),
  fill = "node",
  font_size = 18,
  node_width = 30,
  color_choices = NULL,
  drill_down = TRUE
)

Arguments

design

Metadata from which to extract the categories/numbers.

factors

Factors/columns in the metadata to count and plot.

fill

Use either the current or next node for coloring the transitions.

font_size

Chosen font size, perhaps no longer needed?

node_width

Make nodes more or less rectangular with this.

color_choices

Either a named vector of states and colors, or NULL (in which case it will use viridis.)

drill_down

When true, this will end in the product of the factor levels number of final states. (e.g. if there are 2 sexes, 3 visits, and 4 genotypes, there will be 2, 6, 24 states going from right to left). If FALSE, there will be 2,3,4 states going from right to left.

Value

List containing a couple of plots, one interactive, one gg.


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.