title: ggalluvial ordering stratum
body: <p>I've been trying to make some sankey diagrams with the <a href="https://cran.r-project.org/web/packages/ggalluvial/vignettes/ggalluvial.html" rel="nofollow noreferrer">ggalluvial package</a>. I rather like it but I'm having problems controlling the order of the lodes. I'm using the alluvia format described at the start of the vignette.</p>
  
  <p>Basically my diagram is showing subsets of level 2 and level 3 of one time point and how they move to another time point. The problem is that I can't for the life of me figure out how to force the order of the stratum as the diagram is unreadable without the order being correct. Here's my code:</p>
  
  <pre><code>library("ggalluvial")
  library("ggplot2")
  subsank_math = structure(list(`Winter Projection` = structure(c(2L, 2L, 2L, 
                                                                  2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 
                                                                  5L, 5L, 5L, 5L, 5L), .Label = c("Level 5", "Level 4", "Level 3", 
                                                                                                  "Level 2", "Level 1"), class = "factor"), subgroup = structure(c(1L, 
                                                                                                                                                                   2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 
                                                                                                                                                                   6L, 1L, 2L, 3L, 4L, 5L, 6L), .Label = c("Level 3 (+)", "Level 3", 
                                                                                                                                                                                                           "Level 3 (-)", "Level 2 (+)", "Level 2", "Level 2 (-)"), class = "factor"), 
                                n = c(119, 102, 16, 10, 12, 1, 272, 544, 182, 151, 134, 22, 
                                      40, 239, 204, 326, 663, 225, 0, 15, 12, 44, 215, 219)), row.names = c(NA, 
                                                                                                            -24L), .Names = c("Winter Projection", "subgroup", "n"), class = "data.frame")
  
  
  
  
  ggplot(subsank_math,
             aes(weight = n,
                 axis1 = subgroup, axis2 = `Winter Projection`)) +
  geom_alluvium(aes(fill = subgroup),
                    width = 0, knot.pos = 0, reverse = FALSE) +
  geom_stratum(width = 1/8, reverse = FALSE) +
  geom_text(stat = "stratum", label.strata = TRUE, reverse = FALSE)
  </code></pre>
  
  <p>Kinda strange that it orders the first axis according to the levels of the factor but not the second.
  <a href="https://i.stack.imgur.com/67wi0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/67wi0.png" alt="Wrong ordering sankey"></a></p>