title: stemDocument works in TermDocumentMatrix but does not work in tm_map using tm and R
body: <p>Let's say there is a string "COLORED PENCIL STAEDTLER NORIS CLUB ASSORTED COLORS PKT12". My code is:</p>
  
  <pre><code>&gt; a1 &lt;- VCorpus(VectorSource("COLORED PENCIL STAEDTLER NORIS CLUB ASSORTED COLORS PKT12"))
  &gt; a3 &lt;- TermDocumentMatrix(a1,control = list(stemming=T))
  </code></pre>
  
  <p>The matrix is:</p>
  
  <pre><code>           Docs
  Terms       1
    assort    1
    club      1
    color     2
    nori      1
    pencil    1
    pkt12     1
    staedtler 1
  </code></pre>
  
  <p>So we can see stemDocument works for colored and colors, both of which turned to be color. However, if I do:</p>
  
  <pre><code>&gt; a1 &lt;- VCorpus(VectorSource("COLORED PENCIL STAEDTLER NORIS CLUB ASSORTED COLORS PKT12"))
  &gt; a2 &lt;- a1 %&gt;% tm_map(PlainTextDocument) %&gt;% tm_map(stemDocument,"english")
  &gt; a2[[1]]$content
  [1] "COLORED PENCIL STAEDTLER NORIS CLUB ASSORTED COLORS PKT12"
  &gt; a2 &lt;- a2 %&gt;% TermDocumentMatrix()
  </code></pre>
  
  <p>The matrix is:</p>
  
  <pre><code>           Docs
  Terms       character(0)
    assorted             1
    club                 1
    colored              1
    colors               1
    noris                1
    pencil               1
    pkt12                1
    staedtler            1
  </code></pre>
  
  <p>We can see stemDocument does not work here. I notice that there is "character(0)" here which is not shown in the above matrix. But I do not know why?</p>
  
  <p>My situation is I need to do some pre-processing for the text data like stopWords, stemDocument and so on. Then I need to save this processed text to a csv file. So here I cannot directly use TermDocumentMatrix to generate the matrix. Could anyone help me out here? Thanks a lot.</p>