Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google Trend Download example
## uncomment this and install from github if you don't have it already
# library(devtools)
# devtools::install_github("dvanclev/GTrendsR")
## load library
library(GTrendsR)
## create a connection with your gooooogle account details.
ch <- gconnect('your google email', 'your google pw')
## use the connection to get Google trends data
data <- gtrends(ch, "Greece")
## data downloads several things, such as:
data$trend ## trend over time, weekly, indexed eg: 44 48 47 44 45 49 44 49 46 47
data$searches ## top releated searches eg: "ancient greece" "athens greece" "athens" "greece map" etc.
data$rising ## rising related searches eg: "facebook greece" "google greece" "greece news" "santorini" etc.
## plot stuff
plot(data$trend$greece, type="l")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment