Using the description feature from Online retail dataset, I created a word cloud.
descCorpus <- Corpus(VectorSource(without_weird$Description))
descCorpus <- tm_map(descCorpus, removePunctuation)
descCorpus <- tm_map(descCorpus, removeWords, c('the', 'this',
stopwords('english')))
descCorpus <- tm_map(descCorpus, stemDocument)
wordcloud(descCorpus , max.words = 100, random.order = FALSE)
However, I want the determinant feature of the word cloud to be sales amount instead of frequency. So the higher the sales, the bigger the word.
Reproducible example:
description <- c("36 PENCILS TUBE RED RETROSPOT","HANGING HEART JAR T-LIGHT HOLDER","VICTORIAN SEWING BOX LARGE","CINAMMON SET OF 9 T-LIGHTS","ZINC T-LIGHT HOLDER STARS SMALL","T-LIGHT HOLDER","RABBIT NIGHT LIGHT","WHITE SOAP RACK WITH 2 BOTTLES","BOUDOIR SQUARE TISSUE BOX", "WHITE SKULL HOT WATER BOTTLE","STRAWBERRY CERAMIC TRINKET POT")
sales <-c(4.56,24.96,11.40,15.00,17.85,10.50,20.40,27.04,20.40,15.00,13.00)
df <- data.frame(description, sales)