title: How to (re)arrange panels of facet_wrap/_grid?
body: <p>R noob here. I have been stumped on this graph all day and solutions like <a href="https://stackoverflow.com/questions/20150473/using-facet-grid-and-facet-wrap-together">this</a> and this <a href="https://stackoverflow.com/questions/31776079/multiple-titles-in-facet-wrap-ggplot2?noredirect=1&amp;lq=1">this</a> seem to hold my answer but I cannot get them to work for me.</p>
  <p>I have a data frame that is a large version of the below sample which I am trying to plot using ggplot.</p>
  <pre><code># create data
  df &lt;- data.frame(
    &quot;ID&quot; = rep(1:5, each = 4),
    &quot;Date&quot; = c(seq(as.Date(&quot;2019/09/18&quot;), by = &quot;day&quot;, length.out = 4), 
               seq(as.Date(&quot;2019/09/18&quot;), by = &quot;day&quot;, length.out = 4),
               seq(as.Date(&quot;2020/08/07&quot;), by = &quot;day&quot;, length.out = 4),
               seq(as.Date(&quot;2020/09/12&quot;), by = &quot;day&quot;, length.out = 4),
               seq(as.Date(&quot;2020/09/29&quot;), by = &quot;day&quot;, length.out = 4)),
    &quot;MaxDepth&quot; = round(runif(20, min = 10, max = 50), 1),
    &quot;Trip&quot; = rep(1:5, each = 4)
  )
  
  # plot using ggplot
  ggplot(df, aes(Date, MaxDepth, col = factor(Trip))) + 
    geom_line() + 
    facet_grid(ID ~ format(Date, &quot;%Y&quot;), scales = &quot;free_x&quot;) + 
    scale_y_reverse() + 
    scale_x_date(date_labels = &quot;%b&quot;) + 
    labs(title = &quot;Daily maximum depth\n&quot;, 
         x = &quot;&quot;,
         y = &quot;Depth [m]\n&quot;,
         col = &quot;Fishing trip&quot;)
  </code></pre>
  <p>This turns out nicely as a two column, eleven row faceted graph with the fishing trips as colours.
  <img src="https://i.stack.imgur.com/nEjok.jpg" alt="" /></p>
  <p>However, it includes a lot of empty panels which I would like to avoid by creating a one column graph still with all eleven ID rows but that are separated by the same split label the two columns had. I.e. I would like the two individuals that were in the LHS 2019 plot to have that 2019 label on top, separated by the 2020 label from the other 9 individuals.
  <img src="https://i.stack.imgur.com/deH7I.png" alt="Like in this mock up" />.</p>
  <p>Hope this is clear. Please correct me or let me know what to improve for a better question.
  Grateful for any help! Even if those are suggestions that this is not a good way of representation or something like this is simply not possible. Thank you all!</p>