title: Removing NAs in dataset
body: <p>I need to remove NAs from my data but want to keep the position so the length of each column remain same. 
  I have used </p>
  
  <pre><code>lapply(values, function(x) x[!is.na(x)])
  </code></pre>
  
  <p>and also </p>
  
  <pre><code>removeEMPTYstrings &lt;- function(x) { newVectorWOstrings &lt;- x[x != ""] return(newVectorWOstrings)}
  
  lists &lt;- lapply(as.list(counts), removeEMPTYstrings)
  </code></pre>
  
  <p>but both of them are unable to remove the NAs. Sometimes I'm able to remove them, but lose the positioning and the column length gets changed.<br>
  <a href="https://i.stack.imgur.com/NEsWp.png" rel="nofollow noreferrer">enter image description here</a></p>