riverPlot: Create an alluvial plot

View source: R/river_plot.R

riverPlotR Documentation

Create an alluvial plot

Description

This function creates an alluvial plot.

Usage

riverPlot(
  df,
  title = NULL,
  fillColIndex = 2,
  curveType = "sigmoid",
  alpha = 0.8,
  strataFill = "lightgoldenrod1",
  labelSize = 3,
  axisTextSize = 12,
  axisTitleSize = 12,
  viridisPal = "turbo",
  ...
)

Arguments

df

A data frame with two categorical columns and a numeric column.

title

Plot title.

fillColIndex

Index of column used for coloring the alluvia.

curveType

Curve type.

alpha

Opaqueness level for the colors of the alluvia.

strataFill

Color used for the strata.

labelSize

Size of labels of strata elements.

axisTextSize

Axis text size.

axisTitleSize

Axis title size.

viridisPal

Viridis palette.

...

Other arguments passed to centerTitle.

Value

An object of class gg.

Examples

df <- data.frame(x = sample(c('a','b', 'c', 'd', 'e', 'f'), 20,
replace=TRUE),
y = sample(c('p','q', 'r', 's', 't', 'u', 'v', 'w'), 20,
replace=TRUE),
z = runif(20, 1, 3))
riverPlot(df)


henna documentation built on Feb. 17, 2026, 9:08 a.m.