get.trends: Getting Google Trends

Description Usage Arguments Details Author(s) Examples

Description

The function downloads time series from Google Trends based on a list of queries provided by the user, and stores them as .csv files either under the current working directory or elsewhere as speficied otherwise.

Usage

1
get.trends(queries=NULL, geo="US", time="all", path=getwd())

Arguments

quries

a vector of quries to get Google Trends for.

geo

character, indicating the geographic location for the queries. Defualt is "US".

time

character, indicating the time span for the queries. Defualt is "all".

path

string, denoting the directory under which the csv files should be stored.

Details

Supported countries and their corresponding country codes can be found by calling data("countries"). For more details, refer to gtrends.

Author(s)

Zehua Wu

Examples

1
2
3
4
dir="~/Documents/Inflation"
data("US_Inflation_Queries")
inflation<-as.character(US_Inflation_Queries$Queries)
get.trends(queries=inflation, geo="US", time="all", path=dir)

google-trends-v1/gtm documentation built on June 5, 2019, 5:13 p.m.