Nested facets in ggplot2 spanning groups
<p>I encountered a situation in which I want to create a plot that was facetted by three grouping variables. To do so, I would simply use <code>facet_grid(f1 ~ f2 + f3)</code>, but the issue here is that the labels for f2 would be redundant, and it would be much better to have them span the facets for f3 nested within f2.</p>

<p>MWE:</p>

<pre><code>library('tibble')
library('ggplot2')
df &lt;- tribble(
  ~x, ~y, ~f1, ~f2, ~f3,
  0.5, 0.5, "a", "a", "a",
  0.5, 0.5, "b", "a", "a",
  0.5, 0.5, "a", "b", "a",
  0.5, 0.5, "b", "b", "a",
  0.5, 0.5, "a", "a", "b",
  0.5, 0.5, "b", "a", "b",
  0.5, 0.5, "a", "b", "b",
  0.5, 0.5, "b", "b", "b"
)


p &lt;- ggplot(df, aes(x = x, y = y)) +
  geom_point() +
  facet_grid(f1 ~ f2 + f3)
</code></pre>

<p><a href="https://i.stack.imgur.com/H8Bid.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H8Bid.png" alt="MWE of nested facet plot"></a></p>

<p>Again, I'm looking to combine the labels for f2 so that they are not so redundant.</p>

<p>Edit: This is different from other questions in that it asks how to use the existing groupings to modify a facet as opposed to adding a new one. </p>