Google trends is a service that shows the relative frequency of different google searches over time. This can be useful supplementary information, for example to measuring trends on Twitter. You can get data by search term, dates, country, and on other criteria.
For example, this code shows the relative prevalence of searches including the terms “data is” and “data are” over the past 10 years:
library(gtrendsR) #don’t forget install.packages must be done once.
user <- “<Google account email>” ## You must have a Google account. You can set one up just for this purpose.
psw <- “<Google account password>” ##Be sure it does not use 2-factor authentication
gconnect(usr, psw) #This only has to be done once (per day? per session?)
G_trend <- gtrends(c(“Obamacare”, “health care”), res=”7d”) #retrieves the data
plot(G_trend) #shows a quick plot
- The numbers are relative, not absolute. The scale seems to always go 0 to 100, and there is no way to translate those numbers into an absolute number of queries. I suggest reading Google’s documentation of google trends, before you rely on it.
- the gtrends function returns a list. The exact shape of the list depends on the query you issue. The most important numerical data is in a data frame called Result_name$trend .