Common text mining visuals

Text Mining with Bag-of-Words in R

Ted Kwartler

Instructor

Why make visuals?

  • Good visuals lead to quick conclusions
  • The brain efficiently processes visual information
Text Mining with Bag-of-Words in R

Setting the scene

tweet_topics.png

Text Mining with Bag-of-Words in R

Setting the scene

vector.png

Text Mining with Bag-of-Words in R

Term frequency plots with tm

# Convert TDM to matrix
coffee_m <- as.matrix(coffee_tdm)

# Sum rows and sort by frequency term_frequency <- rowSums(coffee_m) term_frequency <- sort(term_frequency, decreasing = TRUE)
# Create a barplot barplot(term_frequency[1:10], col = "tan", las = 2)

tf_plot.png

Text Mining with Bag-of-Words in R

Term frequency plots with qdap

# Load qdap package
library(qdap)

# Find term frequencies frequency <- freq_terms( tweets$text, top = 10, at.least = 3, stopwords = "Top200Words" )
# Plot term frequencies plot(frequency)

 

qdap_plot.png

Text Mining with Bag-of-Words in R

Let's practice!

Text Mining with Bag-of-Words in R

Preparing Video For Download...