title: How do I clean twitter data in R?
body: <p>I extracted tweets from twitter using the twitteR package and saved them into a text file. </p>
  
  <p>I have carried out the following on the corpus </p>
  
  <pre><code>xx&lt;-tm_map(xx,removeNumbers, lazy=TRUE, 'mc.cores=1')
  xx&lt;-tm_map(xx,stripWhitespace, lazy=TRUE, 'mc.cores=1')
  xx&lt;-tm_map(xx,removePunctuation, lazy=TRUE, 'mc.cores=1')
  xx&lt;-tm_map(xx,strip_retweets, lazy=TRUE, 'mc.cores=1')
  xx&lt;-tm_map(xx,removeWords,stopwords(english), lazy=TRUE, 'mc.cores=1')
  </code></pre>
  
  <p>(using mc.cores=1 and lazy=True as otherwise R on mac is running into errors)</p>
  
  <pre><code>tdm&lt;-TermDocumentMatrix(xx)
  </code></pre>
  
  <p>But this term document matrix has a lot of strange symbols, meaningless words and the like.
  If a tweet is </p>
  
  <pre><code> RT @Foxtel: One man stands between us and annihilation: @IanZiering.
   Sharknado‚Äã 3: OH HELL NO! - July 23 on Foxtel @SyfyAU
  </code></pre>
  
  <p>After cleaning the tweet I want only proper complete english words to be left , i.e a sentence/phrase void of everything else (user names, shortened words, urls)</p>
  
  <p>example: </p>
  
  <pre><code>One man stands between us and annihilation oh hell no on 
  </code></pre>
  
  <p>(Note: The transformation commands in the tm package are only able to remove stop words, punctuation whitespaces and also conversion to lowercase)</p>