title: How to replace ALL NA in ffdf columns?
body: <p>I have an ffdf object with 200K rows and 12K columns. </p>
  
  <p>This is from a LEFT JOIN with another ffdf object, so has a lot of NA across the different columns. </p>
  
  <p>How can I replace all NA with a specific value (say, FALSE, since the additional columns from the LEFT JOIN are all LOGICAL)? </p>
  
  <p>I can successfully use the following syntax over one column to replace all NA in that column ("coltest"): </p>
  
  <pre><code>ffdfOut$coltest &lt;- with(ffdfOut, ifelse(is.na(coltest), FALSE, coltest))
  </code></pre>
  
  <p>but the following loop: </p>
  
  <pre><code>cnamesLogical) &lt;- colnames(ffdfOut)[12:12000]
  for(colname in cnamesLogical)
  {
   ffdfOut[, colname] &lt;- with(ffdfOut, ifelse(is.na(colname), FALSE, colname))
  }
  </code></pre>
  
  <p>gives me error:</p>
  
  <p>Error in with.ffdf(ffdfOut, ifelse(is.na(colname), FALSE, colname)) : 'with.ffdf' only returns ff object of equal length of nrow(data)</p>
  
  <p>Thanks for any help on this! </p>