title: mapping over lists and creating a train and test split
body: <p>I have a list of data frames and I would like to split each of the lists into a training and testing set.</p>
  
  <p>What I am trying is the following:</p>
  
  <pre><code>library(furrr)
  library(purrr)
  library(dplyr)
  train &lt;- df %&gt;% 
    future_map(., ~as_tibble(.) %&gt;% 
                 sample_frac(0.70))
  
  test &lt;- df %&gt;% 
    future_map2(., ~anti_join(df, train, by = "ID"))
  </code></pre>
  
  <p>I am getting an error on the <code>test</code> part of the code.</p>
  
  <p>The error is telling me that:</p>
  
  <blockquote>
    <p>argument ".f" is missing, with no default</p>
  </blockquote>
  
  <p>The function <code>.f</code> I want to apply is the <code>anti_join</code> function.</p>
  
  <p>Data:</p>
  
  <pre><code>df &lt;- list(structure(list(ID = c(32854L, 87264L, 10046L, 19734L, 46776L, 
  69104L), Var1 = c(0.422291041272086, 0.421857549178741, 0.833626138132112, 
  0.0548106066414176, 0.624276309555977, 0.71510623528032), Var2 = c(12.1523922938606, 
  11.8078760576117, 15.0796093186172, 14.6689943885814, 16.2489940803754, 
  12.6618473977339)), row.names = c(NA, -6L), class = c("tbl_df", 
  "tbl", "data.frame")), structure(list(ID = c(64813L, 28351L, 
  98206L, 11662L, 39650L, 48688L), Var1 = c(0.7736786, 0.9184715, 
  0.6961003, 0.904335, 0.2900523, 0.5886406), Var2 = c(14.9093, 
  14.37623, 13.50509, 13.84473, 12.35784, 14.02979)), row.names = c(NA, 
  -6L), class = c("tbl_df", "tbl", "data.frame")), structure(list(
      ID = c(34745L, 20879L, 16576L, 23177L, 64122L, 23805L), Var1 = c(0.4781384, 
      0.89258, 1.993566, 0.291347, 0.1067107, 0.866149), Var2 = c(12.96561, 
      12.33563, 11.8721, 14.79747, 13.08436, 14.70748)), row.names = c(NA, 
  -6L), class = c("tbl_df", "tbl", "data.frame")), structure(list(
      ID = c(42108L, 11726L, 78484L, 36898L, 60224L, 61154L), Var1 = c(0.877778213319744, 
      1.33963228732897, 0.806292976614067, 0.972259512214242, NA, 
      0.756496381825957), Var2 = c(11.5246035772182, 11.6156242530741, 
      12.9551613288682, 13.1341296830114, NA, 13.9791350710985)), row.names = c(NA, 
  -6L), class = c("tbl_df", "tbl", "data.frame")))
  </code></pre>