title: How do I keep special characters which searching for term frequencies?
body: <p>I have a document out of which I have special characters along with text such as <code>!</code>, <code>#</code>, <code>@</code>, <code>$</code>, <code>%</code> and more. The following code is used to obtain the most frequent terms list. But when it is performed, the special characters are missing in the frequent terms list i.e. if <code>"#StackOverFlow"</code> is the word present 100 times in the document, I get it as <code>"StackOverFlow"</code> without <code>#</code> in the frequent terms list. Here is my code:</p>
  
  <pre><code>review_text &lt;- paste(rome_1$text, collapse=" ")
  #The special characters are present within review_text
  review_source &lt;- VectorSource(review_text)
  corpus &lt;- Corpus(review_source)
  corpus &lt;- tm_map(corpus, stripWhitespace)
  corpus &lt;- tm_map(corpus, removeWords, stopwords("english"))
  dtm &lt;- DocumentTermMatrix(corpus)
  dtm2 &lt;- as.matrix(dtm)
  frequency &lt;- colSums(dtm2)
  frequency &lt;- sort(frequency, decreasing = TRUE)
  head(frequency)
  </code></pre>
  
  <p>Where exactly have I gone wrong here?</p>