Text mining with package tm, using removeWords(). I have a list of about 500 relevant words out of several thousand total. Can I use use removeWords() to reverse the logic and remove the words from the Corpus that are NOT in the list?
With Perl, I could do something like this:
$diminishedText = (fullText =! s/$wordlist//g); #not tested
In R, this removes the words in the word list:
text <- tm_map(text, removeWords, wordList)
What would be the correct syntax for doing something like this?
text <- tm_map(text, removeWords, not in wordList)