2. Load the wordcloud package. Generate a word cloud that shows the 30 most frequently used bigrams in 1000 positive reviews (we8thereCounts[1:1000]). Generate a word cloud that shows the top 30 most frequently used bigrams in 1000 negative reviews (we8thereCounts[5166:6166]). Copy and paste the two word clouds below. Here is my example of a word cloud: > dim(we8thereCounts) > badwords=colSums(as.matrix(we8thereCounts[5166:6166,])) > wordcloud(names(badwords), badwords, max.words=30, col=badwords+1)

Respuesta :

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:

Ver imagen hamzafarooqi188
Ver imagen hamzafarooqi188