Answer:
R Code:
> library("textir", lib.loc="~/R/win-library/3.4")
> data(we8there)
> dim(we8thereCounts)
[1] 6166 2640
> library(wordcloud)
> goodwords=colSums(as.matrix(we8thereCounts[1:1000,]))
> wordcloud(names(goodwords), goodwords, max.words=30, col=goodwords+1)
> dim(we8thereCounts)
[1] 6166 2640
> badwords=colSums(as.matrix(we8thereCounts[5166:6166,]))
> wordcloud(names(badwords), badwords, max.words=30, col=badwords+1)
Explanation: