Skip to contents

Create an alluvial plot to show how respondents move between segments across multiple models within a model rack. To change the order of models, set factor levels in the model_name column accordingly. To create an alluvial plot for a subset of models (2 for example), simply dplyr::filter the rack object.

Usage

rack_segment_alluvial_plot(rack)

Arguments

rack

A model rack.

Examples

library(dplyr)

rack_segment_alluvial_plot(example_seg_rack)


# use a different order (reverse)
example_seg_rack %>% 
  mutate(across(model_name, forcats::fct_rev)) %>% 
  rack_segment_alluvial_plot()


# flow from nmf_3 to nmf_5
example_seg_rack %>% 
  filter(model_name %in% c("nmf_3", "nmf_5")) %>% 
  rack_segment_alluvial_plot()