title: loop over groups and create plot for each one R
body: <p>I am trying to map/loop over the species column in the Iris data set to create a plot for each species. The below script returns three charts but all have the same data plotted and are not divided by species. The map function appears to ignore the species_list and just looks at the entire dataframe. Been trying a varying approached but can't get any to work. Any help greatly appreciated</p>
  
  <p>Cheers</p>
  
  <pre><code>library(ggplot2) 
  library(purrr) 
  
  species_list = unique(Iris$Species)
  
  species_plot = function(x,y) {
  
       ggplot(data = Iris,colour = Species, aes_string(x=x,y=y)) + 
       geom_point(shape = 21, aes(fill = Species),colour = "black", size =8)
  
   }
  
  
  species_bins = map(species_list, ~species_plot("sepal_length", "sepal_width") )
  </code></pre>