title: Creating a list of plots with map()
body: <p>I have a function that takes a dataset, filters for a given element, and creates a plot. I want to take a vector and use map to filter for each element of the vector and create a plot. Applying <code>map(vector, function)</code> doesn't work--I get the warning</p>
  <blockquote>
  <p>&quot;longer object length is not a multiple of shorter object length&quot;.</p>
  </blockquote>
  <p>Say I have this dataframe <code>names</code>, based on the babynames dataset.</p>
  <pre><code>names &lt;- babynames%&gt;%
    pivot_wider(names_from = sex, values_from = n, values_fill=0) %&gt;%
    group_by(year,name) %&gt;%
    summarize(Female=sum(F), Male=sum(M))  %&gt;%
    mutate(percent = Female/(Male+Female)*100)
  
  and a vector made up of `&quot;Ollie&quot;`, `&quot;Verna&quot;`, and `&quot;Ava&quot;`. I want a graph for each of `Ollie`, `Verna`, and `Ava`.
  
  fun_name &lt;- function(name_1) {
      names %&gt;%
      filter(name==name_1) %&gt;%
      ggplot(aes(x=year, y=percent)) +
      geom_line()
  }
  
  map(vector, fun_name)
  </code></pre>
  <p>The issue I'm specifically having now is that all of the graphs are combined into one.</p>