Word Cloud
Word Cloud
Install.packages(“readxl”)
Install.packages(“tm”)
Install.packages(“wordcloud”)
Install.packages(“topicmodels”)
Install.packages(“ggplot2”)
Install.packages(“treemap”)
Install.packages(“syuzhet”)
# Read the data (assuming the text is in the second column of the first sheet)
# Create a Corpus
Corpus <- tm_map(corpus, removeWords, c(“word 1”, “ word 2”)) # Remove common
stopwords
Mat<-as.matrix(dtm) # creating
Mat
Freq
Set.seed(1)
Wordcloud(words= names(freq),
Freq = freq,
Min.freq =1,
Max.words = 10,
Random.order = FALSE,
Random.color = FALSE,
Rot.per = 0.2,
Colors = brewer.pal(4, “Dark2”))