Skip to content

Instantly share code, notes, and snippets.

@MarkEdmondson1234
Last active February 21, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MarkEdmondson1234/db2f4946fa11eea2a3f8 to your computer and use it in GitHub Desktop.
Save MarkEdmondson1234/db2f4946fa11eea2a3f8 to your computer and use it in GitHub Desktop.
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