powered by
This function creates an alluvial plot.
riverPlot( df, title = "River plot", fillColIndex = 2, curveType = "sigmoid", alpha = 0.8, strataFill = "lightgoldenrod1", labelSize = 3, viridisPal = "turbo", legendPos = "none", margins = margin(0, -10, -10, -10), ... )
An object of class gg.
gg
A data frame with two categorical columns and a numeric column.
Plot title.
Index of column used for coloring the alluvia.
Curve type.
Opaqueness level for the colors of the alluvia.
Color used for the strata.
Size of labels of strata elements.
Viridis palette.
Legend position.
Plot margins. Must be a vector of size 4 listing the desired top, right, bottom and left margin, in that order.
Other arguments passed to centerTitle.
centerTitle
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)
Run the code above in your browser using DataLab