title: Multiple Lines for Text per Legend Label in ggplot2
body: <p>I'm trying to deal with very long labels for a legend in a bar plot (see picture included and the code i used to produce it. I need to break them down in multiple (rows of) lines (2 or 3), other wise the whole picture will be to wide. Some help would be very helpful. Actually I also suspect that my code is not as concise as it should be, but at least it works (but feel free to change)</p>
  
  <p><a href="https://i.stack.imgur.com/CinYu.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/CinYu.jpg" alt="enter image description here"></a></p>
  
  <pre><code>glimpse(df)
  
  Observations: 301
  Variables: 3
  $ V12n     &lt;int&gt; 1, 4, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1...
  $ V12      &lt;fctr&gt; De verwijzer neemt contact op om na te gaa...
  $ METING.f &lt;fctr&gt; Meting 0, Meting 0, Meting 0, Meting 0, Me...
  
  p = ggplot(df, aes(x = V12n, fill = V12)) + 
   geom_bar(aes(y = (..count..)/tapply(..count..,..PANEL..,sum)
   [..PANEL..])) + 
   scale_y_continuous(labels = scales::percent) + 
   geom_text(aes(y = ((..count..)/sum(..count..)), 
                 label = scales::percent((..count..)/tapply(..count..,..PANEL..,sum)[..PANEL..])), 
                 stat = "count", vjust = -0.25) +
   facet_grid(.~ METING.f) +
   labs(title = " ",
     x = "Vraag 12",
     y = "Percentage")  +
   theme(axis.text.x = element_blank(),
         axis.ticks.x=element_blank()) +
   scale_fill_manual(values = c("greenyellow", "green4", "darkorange1", "red"), 
                  name = "Zijn er afspraken gemaakt over het overdragen van de verantwoordelijkheid naar de volgende zorgverlener?\n") 
  
   p
  </code></pre>