I'm very new to making graphs in R and I'm having a hard time producing a simple alluvial plot.
My data is basically something like this (I've already aggregated it):
data<-tibble(working_2019=c("Yes", "No", "Yes", "No"),
working_2022=c("Yes", "No", "No", "Yes"),
obs=c(20,30,40,10))
This is what I have so far, and when I try following other people's code it never works (mostly because all other examples use the option "fill" to get categories within a stratum, and I don't think it's needed here).
ggplot(data, aes(y=obs, axis1=working_2019, axis2=working_2022))+
geom_alluvium( width=0,knot.pos=0, reverse=F)+
geom_stratum(width = 1/16)
I'd like to get something like this, with 2019 as the left axis and 2022 as the right one, and then label each axis with "Working" and "Not Working"
Thanks in advance!