Last active
February 21, 2020 20:52
-
-
Save MarkEdmondson1234/db2f4946fa11eea2a3f8 to your computer and use it in GitHub Desktop.
Google Trend Download example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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