View source: R/amzn_review_wc.R
amzn_review_wc | R Documentation |
Tokenizing text and plotting in wordclouds. Two comparison wordclouds available ("ratings" and "sentiment")
This uses the wordcloud::wordcloud()
function so we have to specify the format and save type beforehand. See examples below
amzn_review_wc(
data,
type = c("overall", "comparison"),
comp_type = c("rating", "sentiment")
)
data |
Data frame created by |
type |
Type of word cloud, either "overall" or "comparison" |
comp_type |
If "comparison," then either "ratings" (1&2 star vs 4&5 star) or "sentiment" (based on the Bing lexicon) |
Wordcloud
## Not run:
amzn_review_wc(data, type = "comparison", comp_type = "rating"),
amzn_review_wc(data, type = "overall")
# To save a wordlcoud:
png("~/Desktop/wordcloud.png") # or any other directory/filename
amzn_review_wc(data, type = "comparison", comp_type = "rating")
dev.off()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.