View source: R/helperfunctions.R
| alluvialplot | R Documentation |
Wrapper around ggalluvium package for ggplot based alluvial plot, for quickly making alluvial plot from "long", "raw" categorical data (such as Seurat object meta.data), rather than two-way counts of categories.
alluvialplot(labelsdf, repel, nudge_x, ggfittext, ...)
labelsdf |
data.frame with two columns of raw categorical label: for example, each row is a cell (or other observation), and each column is metadata column 1 and metadata column 2 |
repel |
T/F, whether to repel the labels, default = T |
nudge_x |
numeric, default nudge to the left and right of the repel labels, default 0.2 |
ggfittext |
T/F - whether to use ggfittext, to try to squeeze or remove tiny stratum labels |
... |
a ggplot object
#labelsdf can look like this, row.names of cells not needed,
# just two columns of categorical data as a data.frame:
From To
AACCCAAGCATGCGA-1 Malignant 2
AAACCCAAGTAGGTTA-1 Malignant 2
AAACCCACAAAGCACG-1 Neutrophil 0
AAACCCACAGCAGTAG-1 Malignant 2
AAACCCACATACCGTA-1 Malignant 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.