title: Combining vectors of unequal size using rbind.na
body: <p>I've imported some data files with an unequal number of columns and was hoping to create a data frame out of them. I've use lapply to convert them into vectors, and now I'm trying to put these vectors into a data frame.</p>
  
  <p>I'm using rbind.na from the package {qpcR} to try out and fill out the remaining elements of each vector with NA so they all become the same size. For some reason the function isn't being recognized by do.call. Can anyone figure out why this is the case?</p>
  
  <pre><code>library(plyr)
  library(qpcR)
  
  files &lt;- list.files(path = "C:/documents", pattern = "*.txt", full.names = TRUE)
  
  readdata &lt;- function(x)
  {
      con &lt;- file(x, open="rt")
      mydata &lt;- readLines(con, warn = FALSE, encoding = "UTF-8")
      close(con)
      return(mydata)
  }
  
  all.files &lt;- lapply(files, readdata)
  combine &lt;- do.call(rbind.na, all.files)
  </code></pre>
  
  <p>If anyone has any potential alternatives they can think of I'm open to that too. I actually tried using a function from <a href="http://ryouready.wordpress.com/2009/01/23/r-combining-vectors-or-data-frames-of-unequal-length-into-one-data-frame/" rel="nofollow">here</a> but my output didn't give me any columns. </p>
  
  <p>Here is the error:</p>
  
  <pre><code>Error in do.call(rbind.na, all.files) : object 'rbind.na' not found
  </code></pre>
  
  <p>The package has definitely been installed too.</p>
  
  <p>EDIT: changed cbind.na to rbind.na for the error.</p>