title: Form bigrams without stopwords in R
body: <p>I have some trouble with bigram in text mining using R recently.
  The purpose is to find the meaningful keywords in news, for example are "smart car" and "data mining".</p>
  
  <p>Let's say if  I have a string as follows: </p>
  
  <pre><code>"IBM have a great success in the computer industry for the past decades..."
  </code></pre>
  
  <p>After removing stopwords("have","a","in","the","for"),</p>
  
  <pre><code>"IBM great success computer industry past decades..."
  </code></pre>
  
  <p>In a result, bigrams like "success computer" or "industry past" will occur.</p>
  
  <p>But what I really need is that there exist no stopwords between two words, like "computer industry" is a clear example of bigram for what I want.</p>
  
  <p>The part of my code is below:</p>
  
  <pre><code>corpus &lt;- tm_map(corpus, removeWords, stopwords("english"))
  corpus &lt;- tm_map(corpus, stripWhitespace) 
  corpus &lt;- tm_map(corpus, stemDocument)
  NgramTokenizer = function(x) {unlist(lapply(ngrams(words(x), 2), paste, collapse = " "), use.names = FALSE)}
  dtm &lt;- TermDocumentMatrix(corpus, control = list(tokenize = NgramTokenizer))
  </code></pre>
  
  <p>Is there any method to avoid the result with words like "success computer" when TF counting?</p>