amzn_review_wc: Review Wordclouds

View source: R/amzn_review_wc.R

amzn_review_wcR Documentation

Review Wordclouds

Description

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

Usage

amzn_review_wc(
  data,
  type = c("overall", "comparison"),
  comp_type = c("rating", "sentiment")
)

Arguments

data

Data frame created by GSPtext::get_reviews() or in the same format

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)

Value

Wordcloud

Examples

## 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)

taylorgrant/GSPtext documentation built on April 15, 2023, 10:56 p.m.