title: Why rbind throws a warning
body: <p>This is related to <a href="https://stackoverflow.com/questions/25102617/are-there-more-elegant-ways-to-transform-ragged-data-into-a-tidy-dataframe">Are there more elegant ways to transform ragged data into a tidy dataframe</a></p>
  
  <p>Why following code is not working:</p>
  
  <pre><code>events = structure(list(date = structure(c(-714974, -714579, -717835), class = "Date"), 
      days = c(1, 6, 0.5), name = c("Intro to stats", "Stats Winter school", 
      "TidyR tools"), topics = c("probability|R", "R|regression|ggplot", 
      "tidyR|dplyr")), .Names = c("date", "days", "name", "topics"
  ), row.names = c(NA, -3L), class = "data.frame")
  
  &gt; newdf &lt;- data.frame(topic=character(), days=character())
  &gt; for(i in 1:length(events$topics)){
  + xx = unlist(strsplit(events$topics[i],'\\|'))
  + for(j in 1:length(xx)){
  + yy = c(xx[j], events$days[i]/length(xx))
  + print(yy)
  + newdf=rbind(newdf, yy)
  + }
  + }
  [1] "probability" "0.5"        
  [1] "R"   "0.5"
  [1] "R" "2"
  [1] "regression" "2"         
  [1] "ggplot" "2"     
  [1] "tidyR" "0.25" 
  [1] "dplyr" "0.25" 
  There were 11 warnings (use warnings() to see them)
  &gt; newdf
    X.probability. X.0.5.
  1    probability    0.5
  2           &lt;NA&gt;    0.5
  3           &lt;NA&gt;   &lt;NA&gt;
  4           &lt;NA&gt;   &lt;NA&gt;
  5           &lt;NA&gt;   &lt;NA&gt;
  6           &lt;NA&gt;   &lt;NA&gt;
  7           &lt;NA&gt;   &lt;NA&gt;
  &gt; 
  &gt; warnings()
  Warning messages:
  1: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA ... :
    invalid factor level, NAs generated
  2: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA,  ... :
    invalid factor level, NAs generated
  3: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, 1L,  ... :
    invalid factor level, NAs generated
  4: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA,  ... :
    invalid factor level, NAs generated
  5: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, 1L,  ... :
    invalid factor level, NAs generated
  6: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA,  ... :
    invalid factor level, NAs generated
  7: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, 1L,  ... :
    invalid factor level, NAs generated
  8: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA,  ... :
    invalid factor level, NAs generated
  9: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, 1L,  ... :
    invalid factor level, NAs generated
  10: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, NA,  ... :
    invalid factor level, NAs generated
  11: In `[&lt;-.factor`(`*tmp*`, ri, value = structure(c(1L, 1L,  ... :
    invalid factor level, NAs generated
  &gt; 
  </code></pre>
  
  <p>yy is okay but rbind is not working. Where is the error and how can it be corrected? Thanks for your help.</p>