gtrendsR v1.3.5

0

Monthly downloads

0th

Percentile

Perform and Display Google Trends Queries

An interface for retrieving and displaying the information returned online by Google Trends is provided. Trends (number of hits) over the time as well as geographic representation of the results can be displayed.

Readme

gtrendsR Travis-CI Build Status AppVeyor Build Status Package-License CRAN Downloads

gtrendsR provides an interface for retrieving and displaying Google Trends information.

Trends (number of hits) over time as well as geographic representation of the results can be displayed.

Example

In this simple example, trends for keywords nhl, nba and nfl are retrieved and then plotted from R.

library(gtrendsR)
usr <- "user@gmail.com"  # alternatively store as options() or env.var
psw <- "password"        # idem
gconnect(usr, psw)       # stores handle in environment
sport_trend <- gtrends(c("nhl", "nba", "nfl"))
plot(sport_trend)        # data set also included in package

result of sport_trend query

It is also possible to plot geographical data using googleVis as follow.

plot(sport_trend, type = "geo", which = 5)
plot(sport_trend, type = "geo", which = 6)
plot(sport_trend, type = "geo", which = 7)

Should you have trouble connecting, and also use two-factor authentication on your Google Account, then consider creating another Google account (without two-factor authentication) which should allow automated (i.e. programmatic) connection here.

Installation

Since release 1.3.0, the package is on CRAN and can be installed via

install.packages("gtrendsR")

Pre-release versions can be install directly from this repository via

if (!require("devtools")) install.packages("devtools")
devtools::install_github("PMassicotte/gtrendsR")

Authors

Philippe Massicotte and Dirk Eddelbuettel

License

GPL (>= 2)

Functions in gtrendsR

Name Description
gtrends Google Trends Query
sport_trend Google Trends sport data
gconnect Connect to Google account
countries Word countries ISO code.
categories Google Trends categories.
No Results!

Last month downloads

Details

Type Package
Date 2016-11-03
License GPL (>= 2)
BugReports https://github.com/PMassicotte/gtrendsR/issues
URL https://github.com/PMassicotte/gtrendsR
LazyData yes
RoxygenNote 5.0.1
NeedsCompilation no
Packaged 2016-11-03 13:53:57 UTC; pmassicotte
Repository CRAN
Date/Publication 2016-11-03 19:15:03

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/gtrendsR)](http://www.rdocumentation.org/packages/gtrendsR)