title: How to use igraph in R to graph twitter text data
body: <p>I'm looking for a bit of help filling in the numerous blanks in my experience when it comes to using <code>igraph</code> package in R to create a graph of the common words used by 5 twitter accounts. My aim is to see which keywords the accounts share and identify others that are common to 1 account and not others.</p>
  
  <p>I've created a wordcloud from the tweet text but I'd appreciate any help from the communities in converting (if possible) that to a graph. So far I have a <code>TermDocumentMatrix</code> using the <code>tm</code> package showing the frequency from the <code>wordcloud</code> and I'd like to incorporate that frequency data into the final plot as well. </p>
  
  <p>I'm not sure what format my data needs to be or where I should start (dataframe, Corpus, Matrix) Any pointers?</p>
  
  <p>This is what manipulations I have done to clean and process the data</p>
  
  <p>Clean up the tweet text stored in a dataframe called tweetsDF and column "text" to find the common words used. Start by removing the hashtags from the text using the <code>qdapRegex</code> package:</p>
  
  <pre><code>Text &lt;- rm_hash(tweetsDF$text, clean=TRUE, trim=TRUE)
  # Remove the twitter shortened urls using the qdapRegex package
  
  TextNoShortURL &lt;-rm_twitter_url(Text, trim = TRUE, clean = TRUE,extract = FALSE)
  
  # Create a Term Document Matrix but remove the Punctuation, common english words and exclude "and" "the" "for" using the tm package
  
  TextTDM = TermDocumentMatrix(TextCorpus,control = list(removePunctuation =TRUE,stopwords("english"),stopwords =c("the","for","and"),removeNumbers = FALSE))
  
  # Convert it to a Matrix
  
  TextMatrix &lt;- as.matrix(TextTDM)
  
  # Get the frequency of the words found in the text
  
  MainWord_freqs = sort(rowSums(TextMatrix), decreasing=TRUE) 
  
  # Convert it to a dataframe
  
  TextDF &lt;- data.frame(word=names(MainWord_freqs), freq=MainWord_freqs)
  
  # And you end up with a dataframe contains each word and how often it was included in text, the  twitter handle isn't included here but I assume I can mutate the dataframe to include it  
  
  &lt;PRE&gt;
               row.names        word        freq
  1            shop             shop        8765
  2            food             food        924
  3            drink            drink        8273
  ..
  &lt;/PRE&gt;
  </code></pre>
  
  <p>I'm not sure where to go from here so I have a data source suitable for igraph that will allow me to associate the twitter handle XYZ with the main words used</p>