title: Grouping by multiple columns for ggplot
body: <p>I have data that look like this (I'm only including the first twenty rows to show the spread of data but there are about 135 rows):</p>
  <pre><code>&gt; dput(id)
  structure(list(date = c(&quot;7/27/1992&quot;, &quot;7/27/1992&quot;, &quot;7/27/1992&quot;, 
  &quot;8/1/1992&quot;, &quot;7/1/1994&quot;, &quot;7/1/1994&quot;, &quot;7/1/1994&quot;, &quot;8/7/2003&quot;, &quot;8/7/2003&quot;, 
  &quot;8/7/2003&quot;, &quot;8/7/2003&quot;, &quot;7/21/2004&quot;, &quot;7/21/2004&quot;, &quot;7/26/2004&quot;, 
  &quot;7/26/2004&quot;, &quot;7/5/2005&quot;, &quot;7/5/2005&quot;, &quot;7/9/2005&quot;, &quot;7/9/2005&quot;, 
  &quot;7/9/2005&quot;), event.id = c(8L, 8L, 8L, 10L, 11L, 11L, 11L, 14L, 
  14L, 15L, 15L, 17L, 17L, 18L, 18L, 20L, 20L, 21L, 21L, 21L), id = c(&quot;L5&quot;, &quot;L58&quot;, 
  &quot;L73&quot;, &quot;L21&quot;, &quot;L5&quot;, &quot;L58&quot;, &quot;L73&quot;, &quot;L5&quot;, &quot;L73&quot;, &quot;L7&quot;, &quot;L57&quot;, &quot;L21&quot;, 
  &quot;L47&quot;, &quot;L54&quot;, &quot;L100&quot;, &quot;J27&quot;, &quot;J31&quot;, &quot;J16&quot;, &quot;J26&quot;, &quot;J36&quot;), sex = structure(c(1L, 
  2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 
  1L, 2L, 1L), .Label = c(&quot;0&quot;, &quot;1&quot;), class = &quot;factor&quot;), 
  age = c(28L, 12L, 6L, 42L, 30L, 14L, 8L, 39L, 17L, 42L, 26L, 
  54L, 30L, 27L, 3L, 14L, 10L, 33L, 14L, 6L), matr = c(&quot;L9&quot;, 
  &quot;L9&quot;, &quot;L9&quot;, &quot;L21&quot;, &quot;L9&quot;, &quot;L9&quot;, &quot;L9&quot;, &quot;L9&quot;, &quot;L9&quot;, &quot;L37&quot;, &quot;L45&quot;, 
  &quot;L21&quot;, &quot;L21&quot;, &quot;L35&quot;, &quot;L35&quot;, &quot;J4&quot;, &quot;J4&quot;, &quot;J7&quot;, &quot;J7&quot;, &quot;J7&quot;),
  matralive = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 1L, 1L,
  0L, 0L, 0L, 0L, 0L, 0L, 0L), pod = c(&quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, 
  &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;L&quot;, &quot;J&quot;, &quot;J&quot;, 
  &quot;J&quot;, &quot;J&quot;, &quot;J&quot;)), row.names = c(NA, -134L), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>My goal is to create a graph that looks something like this, using ggplot:</p>
  <p><a href="https://i.stack.imgur.com/7dPg1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7dPg1.png" alt="enter image description here" /></a></p>
  <p>I'm stuck as to how to generate this - I imagine I will have to group by pod and matriline, but am unsure how to go about this.</p>
  <p>Any help is super appreciated - thank you so much!!</p>