title: Creating a list from an existing dataframe based on dplyr functions
body: <p>I currently have a datatframe similar to this one:</p>
  
  <pre><code>df &lt;- tibble("Fam_Name" = c("Architecture", "Arts", "Business", "Managers", "Medicine", "Science"), "Code" = c(1,1,2, 2,3, 3), "Share_2002" = c(0.116, 3.442, 2.445, 1.932, 0.985, 0.321), "Share_2018" = c(0.161, 0.232, 1.234, 0.456, 0.089, 0.06))
  </code></pre>
  
  <p>I would like to create a list called <code>family</code> which contains three other lists: <code>fam1, fam2, fam3</code></p>
  
  <p>Each <code>fam(i)</code> list would contain two dataframes called <code>fam_normal</code> and <code>fam_long</code> which are constructed based on dplyr functions, for instance:</p>
  
  <pre><code>fam_normal &lt;- df %&gt;% # I am not sure how to write this so that it is incorporated into the fam(i) list
                filter(Code == i) %&gt;%
                rename("2002" = Share_2002,
                       "2018" = Share_2018)
  
  fam_long &lt;- fam_normal %&gt;%
                gather(Year, Share, 3:4) %&gt;%
                arrange(Fam_Name)
  </code></pre>
  
  <p>The end goal is to plot a graph for each <code>fam(i)</code> in the <code>fam</code> list where there are Years on the x-axis and Shares on the y-axis.</p>
  
  <p>My real dataset has 25 families and more years.</p>