Will, (if required) recode the data to Alluvial or Lasagna format using recode_long_alluvial or recode_long_lasagna as required, and provide a complete ready-to-output plot for iNZight or other purposes.

iz_plot_alluvial(...)

# S3 method for longZightAlluv
iz_plot_alluvial(
  .data,
  response,
  xlab = "Wave",
  title = paste0("Plot of ", response),
  completecases = FALSE,
  highlight = NULL,
  plot.mode = 1,
  focus = NULL,
  ...
)

# S3 method for longZightLasagna
iz_plot_alluvial(
  .data,
  response,
  xlab = "Wave",
  title = paste0("Plot of ", response),
  completecases = FALSE,
  highlight = NULL,
  plot.mode = 1,
  ...
)

# S3 method for longZight
iz_plot_alluvial(
  .data,
  response,
  xlab = "Wave",
  title = paste0("Plot of ", response),
  completecases = FALSE,
  highlight = NULL,
  plot.mode = 1,
  focus = NULL,
  ...
)

Arguments

.data

A longZight object generated by load_long_data

response

The response variable to be plotted as an Alluvial plot

xlab

Optional x-axis label

title

Optional title

completecases

Logical variable to exclude incomplete cases

highlight

Response level to be highlighted

plot.mode

Integer between 1 and 3. 1 for "Colour by Origin" mode, 2 for "Transitional" mode and 3 for "Trace Flow" mode.

focus

Time period to use as focus/origin point (only for plot.mode = 1 or if .data inherits the longZightAlluv class)

Value

ggplot2 plot with the data represented as an Alluvial diagram

Examples

if (FALSE) { mydata %>% load_long_data(IDind, WAVE) %>% refactor_wave %>% iz_plot_alluvial(A5E, completecases = TRUE) }