Generates a ggplot2 plot of the response variable encoded in the longZightAlluv or longZightLasagna object, plots are returned allowing further customisation using standard ggplot2 geometries.

plot_long_alluvial(.data, ...)

# S3 method for longZightAlluv
plot_long_alluvial(
  .data,
  fillfunc = ggplot2::scale_fill_discrete(),
  highlight = NULL,
  focus = NULL
)

# S3 method for longZightLasagna
plot_long_alluvial(
  .data,
  alluvium = FALSE,
  fillfunc = ggplot2::scale_fill_discrete(),
  highlight = NULL,
  ...
)

Arguments

.data

A longZightAlluv or longZightLasagna object generated by recode_long_alluvial or recode_long_lasagna respectively

fillfunc

The fill function to use for colouring Alluvial flows, defaults to ggplot2::scale_fill_discrete(), but alluvial_fill_discrete must be used if highlight is set.

highlight

Response level to be highlighted

focus

Time period to use as focus/origin point (only if .data inherits the longZightAlluv class)

alluvium

Logical, if .data inherits the longZightLasagna class, whether to plot transitions (FALSE) or trace flows (TRUE)

Value

ggplot2 plot with the data represented as an Alluvial diagram

Examples

if (FALSE) { mydata %>% load_long_data(IDind, WAVE) %>% refactor_wave %>% recode_long_alluvial(A5E) %>% plot_long_alluvial }