📅  最后修改于: 2022-03-11 14:59:05.503000             🧑  作者: Mango
library(dplyr) # to manipulate data
library(alluvial)
allu <- data %>%
group_by(Diagnose1, Diagnose2, Diagnose3) %>% # grouping
summarise(Freq = n()) # adding frequencies
# here the plot
alluvial(allu[,1:3], freq=allu$Freq)