# NOT RUN {
head(gtrends("NHL")$interest_over_time)
head(gtrends("NHL")$related_topics)
head(gtrends("NHL")$related_queries)
head(gtrends(c("NHL", "NFL"))$interest_over_time)
head(gtrends(c("NHL", "NFL"), geo = c("CA", "US"))$interest_over_time)
## Interest by city
gtrends(keyword = "obama", geo = "US-AL-630")
## Sport category (20)
data(categories)
categories[grepl("^Sport", categories$name), ]
gtrends(c("NHL", "NFL"), geo = c("CA", "US"), category = 20)
gtrends(geo = c("CA"), category = 20)
## Playing with time format
gtrends(c("NHL", "NFL"), time = "now 1-H") # last hour
gtrends(c("NHL", "NFL"), time = "now 4-H") # last four hours
gtrends(c("NHL", "NFL"), time = "now 1-d") # last day
gtrends(c("NHL", "NFL"), time = "today 1-m") # last 30 days
gtrends(c("NHL", "NFL"), time = "today 3-m") # last 90 days
gtrends(c("NHL", "NFL"), time = "today 12-m") # last 12 months
gtrends(c("NHL", "NFL"), time = "today+5-y") # last five years (default)
gtrends(c("NHL", "NFL"), time = "all") # since 2004
## Custom date format
gtrends(c("NHL", "NFL"), time = "2010-01-01 2010-04-03")
## Search from various Google's services
head(gtrends(c("NHL", "NFL"), gprop = "news")$interest_over_time)
head(gtrends(c("NHL", "NFL"), gprop = "youtube")$interest_over_time)
## Language settings
head(gtrends("NHL", hl = "en")$related_topics)
head(gtrends("NHL", hl = "fr")$related_topics)
## Compared breakdown
head(gtrends(keyword = c("nhl", "nba"), geo = "CA", compared_breakdown = FALSE)$interest_by_region)
head(gtrends(keyword = c("nhl", "nba"), geo = "CA", compared_breakdown = TRUE)$interest_by_region)
# }
Run the code above in your browser using DataLab