title: R: Deleting elements from a vector based on element length
body: <p>How can I delete elements from a vector of strings depending on the number of characters or length of the strings?</p>
  
  <pre><code>df &lt;- c("asdf","fweafewwf","af","","","aewfawefwef","awefWEfawefawef")
  &gt; df
  [1] "asdf"            "fweafewwf"       "af"              ""                ""                "aewfawefwef"     "awefWEfawefawef"
  </code></pre>
  
  <p>For example, I may want to delete all elements of <code>df</code> with a length smaller than 5, so the output would be:</p>
  
  <pre><code>&gt; df
  [1]"fweafewwf"        "aewfawefwef"     "awefWEfawefawef"
  </code></pre>
  
  <p>Thanks!</p>