title: R: Removing blanks from the list
body: <p>I'm wondering if there is any way to remove blanks from the list.
  As far as I've searched, I found out that there are many Q&amp;As for removing
  the whole element from the list, but couldn't find the one regarding
  a specific component of the element.</p>
  
  <p>To be specific, the list now I'm working with looks like this:</p>
  
  <pre><code>[[1]]
  [1] "1" ""  ""  "2" ""  ""  "3"
  
  [[2]]
  [1] "weak"
  
  [[3]]
  [1] "22" "33"
  
  [[4]]
  [1] "44"  "34p" "45" 
  </code></pre>
  
  <p>From above, you can find " ", which should be removed.
  I've tried different commands like </p>
  
  <pre><code>text.words.bl &lt;- text.words.ll[-which(text.words.ll==" ")]
  text.words.bl &lt;- text.words.ll[!sapply(text.words.ll, is.null)]
  </code></pre>
  
  <p>etc, but seems like "  "s in [[1]] of the list still remains.</p>
  
  <p>Is it impossible to apply commands to small pieces in each element of the list?
  (e.g. 1, 2, weak, 22, 33... respectively)</p>
  
  <p>I've used "lapply" function to run specific commands to each elements,
  and it seemed like those lapply commands all worked....</p>
  
  <p>JY</p>