title: Using purrr functions to do left join and bind rows
body: <p>I've built a web scraping function that takes a variety of arguments.  Let's use the sample arguments for demonstration purposes.  </p>
  
  <p>Arguments: <code>year</code>, <code>type</code>, <code>gender</code> and <code>col_types</code>.  </p>
  
  <p>My function takes the referenced arguments and scrapes the data to return a <code>df</code>.  </p>
  
  <p>I am looking to join the <code>alternate</code> <code>col_types</code> to <code>standard</code> based on matches at the <code>year</code>, <code>type</code>, <code>gender</code>, <code>name</code>.</p>
  
  <p>Then I want to bind all of the rows to one df.  </p>
  
  <p>Sample Data:</p>
  
  <pre><code>library(dplyr)
  #&gt; 
  #&gt; Attaching package: 'dplyr'
  #&gt; The following objects are masked from 'package:stats':
  #&gt; 
  #&gt;     filter, lag
  #&gt; The following objects are masked from 'package:base':
  #&gt; 
  #&gt;     intersect, setdiff, setequal, union
  
  # Sample DF
  a &lt;- tibble(year = 2019, type = "full_year", col_types = "standard", gender = "M", name = c("a","b","c"), variable_1 = 1:3)
  b &lt;- tibble(year = 2019, type = "full_year", col_types = "alternate", gender = "M", name = c("a","b","c"), variable_2 = 1:3, variable_3 = 8:10)
  c &lt;- tibble(year = 2019, type = "full_year", col_types = "standard", gender = "F", name = c("ab","ba","ca"), variable_1 = 4:6)
  d &lt;- tibble(year = 2019, type = "full_year", col_types = "alternate", gender = "F", name = c("ab","ba","ca"), variable_2 = 1:3, variable_3 = 16:18)
  e &lt;- tibble(year = 2019, type = "last_month", col_types = "standard", gender = "M", name = c("a","b","c"), variable_1 = 1:3)
  f &lt;- tibble(year = 2019, type = "last_month", col_types = "alternate", gender = "M", name = c("a","b","c"), variable_2 = 1:3, variable_3 = 8:10)
  g &lt;- tibble(year = 2019, type = "last_month", col_types = "standard", gender = "F", name = c("ab","ba","ca"), variable_1 = 4:6)
  h &lt;- tibble(year = 2019, type = "last_month", col_types = "alternate", gender = "F", name = c("ab","ba","ca"), variable_2 = 1:3, variable_3 = 16:18)
  
  
  # I know this is not going to work as it presents me with NA where I want there to be joins
  df &lt;- bind_rows(a, b, c, d, e, f, g, h)
  
  # Adding desired output
  df &lt;- bind_rows(a, b, c, d, e, f, g, h)
  
  m_fy_join &lt;- 
    a %&gt;% 
    left_join(b %&gt;% select(-matches("col_types")))
  
  f_fy_join &lt;- 
    c %&gt;% 
    left_join(d %&gt;% select(-matches("col_types")))
  
  m_lm_join &lt;-
    e %&gt;% 
    left_join(f %&gt;% select(-matches("col_types")))
  
  f_lm_join &lt;-
    g %&gt;% 
    left_join(h %&gt;% select(-matches("col_types")))
  
  # Desired Output
  desired_output &lt;- bind_rows(m_fy_join, f_fy_join, m_lm_join, f_lm_join)
  
  </code></pre>
  
  <p>What <code>purrr</code> function can I use to do a left_join, and then bind rows?  </p>