Hi there!
I try to make an alluvial diagram in ggplot2 but I encounter an issue trying to use geom_stratum().
For instance, if I try with this:
ggplot(as.data.frame(UCBAdmissions),
aes(y = Freq, axis1 = Gender, axis2 = Dept)) +
geom_alluvium(aes(fill = Admit), width = 1/12) +
geom_stratum(width = 1/12, fill = "black", color = "grey") +
geom_label(stat = "stratum", aes(label = after_stat(stratum))) +
scale_x_discrete(limits = c("Gender", "Dept"), expand = c(.05, .05)) +
scale_fill_brewer(type = "qual", palette = "Set1") +
ggtitle("UC Berkeley admissions and rejections, by sex and department")
I get :
Warning messages:
1: Computation failed in stat_stratum()
Caused by error in nth()
:
! unused argument (na_rm = na_rm)
2: Computation failed in stat_stratum()
Caused by error in nth()
:
! unused argument (na_rm = na_rm)
with an output plot where alluvial flows are fine but without stratus labels!
If someone could help me please?