Your Google data can be downloaded from https://takeout.google.com/settings/takeout.
by_month <- date_df %>% group_by(month) %>% summarise(count = n())
ggplot(by_month, aes(month, count, label = c("Jan ", "Feb ", "Mar ", "Apr ",
"May ", "Jun ", "Jul ", "Aug ", "Sep ", "Oct ", "Nov ", "Dec "))) + geom_col(fill = "darkgreen") +
scale_x_discrete("month") + geom_text(colour = "white", angle = 90, hjust = 1) +
ggtitle("Number of Google Searches by Month 2016 & 2017")
by_wday <- date_df %>% group_by(wday) %>% summarise(count = n())
ggplot(by_wday, aes(wday, count, label = c("Sunday ", "Monday ", "Tuesday ",
"Wednesday ", "Thursday ", "Friday ", "Saturday "))) + geom_col(fill = "darkgreen") +
scale_x_discrete("") + geom_text(colour = "white", angle = 90, hjust = 1) +
ggtitle("Number of Google Searches by Day of Week 2016 & 2017")
corp1 <- Corpus(VectorSource(search_all_query_text))
corp1 <- tm_map(corp1, tolower)
corp1 <- tm_map(corp1, removePunctuation)
corp1 <- tm_map(corp1, removeWords, stopwords("english"))
dtm <- DocumentTermMatrix(corp1)
freq <- colSums(as.matrix(dtm))
ordered_freq <- order(freq)
top_20 <- freq[tail(ordered_freq, n = 20)]
print(top_20)
## ridley trader twitter 02210 2016 coffee
## 11 11 11 12 13 13
## feather vim airport best data summer
## 13 14 16 16 18 19
## python westin waterfront current location street
## 21 21 23 30 30 39
## nashville boston
## 50 82
wordcloud(dtm$dimnames$Terms, freq, min.freq = 5, max.words = 100)
wordcloud(dtm$dimnames$Terms, freq, min.freq = 3, random.order = TRUE, colors = wes_palette(name = "FantasticFox"))