Visualizes overlapping proportions of multiple grouping variables. See details for more information.

plotRiverplot(
  object,
  grouping_variables,
  fill_by = NULL,
  strata_alpha = 0,
  strata_color = "white",
  strata_fill = "white",
  strata_width = 1/3,
  allv_color = "white",
  allv_type = "xspline",
  allv_width = 1/3,
  clrp = NULL,
  clrp_adjust = NULL,
  ...
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

grouping_variables

Character vector. Names of the grouping variables you want to include in the riverplot.

fill_by

Character value or NULL. If character, denotes the grouping variable that is visualized by color (fill) of the streamlines (alluvias) between the stratas.

strata_alpha

Numeric value. Denotes transparency of the stratas.

strata_color

Character value. Denotes the color used for the borders of all strata.

strata_fill

Character value. Denotes the color used to fill all strata.

strata_width, allv_width

Numeric value. Denotes the width of each stratum, as a proportion of the distance between axes.

allv_type

Character value. Denotes the type of the curve used to produce flows. Use validAlluvialTypes() to obtain all valid input options.

clrp

Character value. Specifies the color palette to be used to represent groups of discrete variables. Run validColorPalettes() to obtain valid input options.

clrp_adjust

Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group.

...

Additional arguments given to scale_color_add_on().

Value

A ggplot.

Details

For an explanation of the vocabulary and essentials of riverplots check out the website of the package ggalluvial at https://corybrunson.github.io/ggalluvial/articles/ggalluvial.html.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF275T_diet

plotRiverplot(object, grouping_variables = c("seurat_clusters", "bayes_space"), fill_by = "bayes_space")