title: map2 error "arguments imply differing number of rows"
body: <p>I was trying to fit a step function to a dataframe and determine how many cut points produce the lowest mse. And I kept having the same error message:</p>
  
  <p><code>Error in data.frame(..., check.names = FALSE) : 
    arguments imply differing number of rows: 149, 1332</code></p>
  
  <p>My codes and the dummy dataframe go as follows:</p>
  
  <pre><code>library(tidyverse)
  library{rsample)
  library(broom)
  library(rcfss)
  
  set.seed(666)
  df &lt;- tibble(egalit_scale = runif(1481, 1, 35), income06 = runif(1481, 1, 25))
  training_df &lt;- vfold_cv(df, 10)
  mse_df &lt;- function(splits, cc){
    model &lt;- glm(egalit_scale ~ cut(income06, cc),
                data = analysis(splits))
    model_mse &lt;- augment(model, newdata = assessment(splits)) %&gt;%
      mse(truth = egalit_scale, estimate = round(.fitted))
    model_mse$.estimate
  }
  
  tidyr::expand(training_df, id, cc = 2:15) %&gt;%
    left_join(training_df) %&gt;%
    mutate(mse = map2(splits, cc, mse_df))
  </code></pre>
  
  <p>The error happens at the step with <code>map2</code>. I tried running each of the 10 folds CV with a specific number of cut points, say 6. It turned out 9 out of the 10 folds worked with the function, but one didn't. Could anyone please help me with this?</p>