title: Apply a ggplot-function per group with dplyr and set title per group
body: <p>I would like to create one separate plot per group in a data frame and include the group in the title.</p>
  
  <p>With the iris dataset I can in base R and ggplot do this</p>
  
  <pre><code>plots1 &lt;- lapply(split(iris, iris$Species), 
    function(x) 
      ggplot(x, aes(x=Petal.Width, y=Petal.Length)) +
        geom_point() +
        ggtitle(x$Species[1]))
  </code></pre>
  
  <p>Is there an equivalent using dplyr?</p>
  
  <p>Here's an attempt using facets instead of title.</p>
  
  <pre><code>p &lt;- ggplot(data=iris, aes(x=Petal.Width, y=Petal.Length)) + geom_point()
  plots2 = iris %&gt;% group_by(Species) %&gt;% do(plots = p %+% . + facet_wrap(~Species))
  </code></pre>
  
  <p>where I use %+% to replace the dataset in p with the subset for each call.</p>
  
  <p><img src="https://i.stack.imgur.com/5fkY1.png" alt="Workaround with facets"></p>
  
  <p>or (working but complex) with ggtitle</p>
  
  <pre><code>plots3 = iris %&gt;%
    group_by(Species) %&gt;%
    do(
      plots = ggplot(data=.) +
        geom_point(aes(x=Petal.Width, y=Petal.Length)) +
        ggtitle(. %&gt;% select(Species) %&gt;% mutate(Species=as.character(Species)) %&gt;% head(1) %&gt;% as.character()))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Y5zrx.png" alt="Working example"></p>
  
  <p>The problem is that I can't seem to set the title per group with ggtitle in a very simple way.</p>
  
  <p>Thanks!</p>