title: what is getText function in text-mining? Where does it come from? [r]
body: <p>I am following a text-mining example from Social Media Mining with R by Nathan Dannerman &amp; Richard Heimann : <a href="https://rads.stackoverflow.com/amzn/click/com/1783281774" rel="nofollow noreferrer" rel="nofollow noreferrer" title="The book">The Book</a> . After pulling tweets using <code>searchTwitter</code> function, the author uses <code>sapply</code> on the <code>list</code> to extract the text portion like this: </p>
  
  <p><code>rstats &lt;- searchTwitter("#rstats", n = 1000)</code></p>
  
  <p><code>rstats_list &lt;- sapply(rstats, function (x) x$getText())</code></p>
  
  <p>This neatly makes a character vector with only the text portion from the tweets. What is getText() ? I can't find anything on it anywhere - the author has not sufficiently explained. I looked at the <code>tm</code> package documentation - nothing! I looked for questions related to this on SO - <a href="https://stackoverflow.com/questions/24829982/getting-text-from-tweets/24832483#24832483">Getting Text From Tweets</a> The answerer is asking the same question as I. On Inside-R, I found this: <a href="http://www.inside-r.org/r-doc/base/gettext" rel="nofollow noreferrer">http://www.inside-r.org/r-doc/base/gettext</a> but it's not the same as <code>getText</code> . Can someone explain what I am missing? </p>