Package gtrendsr. August 4, 2018

Similar documents
Package gtrendsr. October 19, 2017

Package calpassapi. August 25, 2018

Package SEMrushR. November 3, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package fastdummies. January 8, 2018

Package opencage. January 16, 2018

Package datasets.load

Package bisect. April 16, 2018

Package postgistools

Package ECctmc. May 1, 2018

Package repec. August 31, 2018

Package oec. R topics documented: May 11, Type Package

Package validara. October 19, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package condusco. November 8, 2017

Package fitbitscraper

Package docxtools. July 6, 2018

Package githubinstall

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package editdata. October 7, 2017

Package rzeit2. January 7, 2019

Package qualmap. R topics documented: September 12, Type Package

Package dkanr. July 12, 2018

Package facerec. May 14, 2018

Package TrafficBDE. March 1, 2018

Package wikitaxa. December 21, 2017

Package robotstxt. November 12, 2017

Package canvasxpress

Package nlgeocoder. October 8, 2018

Package available. November 17, 2017

Package shinyfeedback

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package spark. July 21, 2017

Package messaging. May 27, 2018

Package splithalf. March 17, 2018

Package WordR. September 7, 2017

Package mdftracks. February 6, 2017

Package knitrprogressbar

Package sessioninfo. June 21, 2017

Package aws.transcribe

Package data.world. April 5, 2018

Package GetITRData. October 22, 2017

Package balance. October 12, 2018

Package kdtools. April 26, 2018

Package barcoder. October 26, 2018

Package jstree. October 24, 2017

Package rgho. R topics documented: January 18, 2017

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package cancensus. February 4, 2018

Package darksky. September 20, 2017

Package essurvey. August 23, 2018

Package omu. August 2, 2018

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package guardianapi. February 3, 2019

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package censusapi. August 19, 2018

Package queuecomputer

Package SNPediaR. April 9, 2019

Package weco. May 4, 2018

Package sigmanet. April 23, 2018

Package QCAtools. January 3, 2017

Package patentsview. July 12, 2017

Package kirby21.base

Package widyr. August 14, 2017

Package spelling. December 18, 2017

Package statsdk. September 30, 2017

Package librarian. R topics documented:

Package fastqcr. April 11, 2017

Package goodpractice

Package geogrid. August 19, 2018

Package wrswor. R topics documented: February 2, Type Package

Package virustotal. May 1, 2017

Package TVsMiss. April 5, 2018

Package effectr. January 17, 2018

Package ecoseries. R topics documented: September 27, 2017

Package sfc. August 29, 2016

Package benchmarkme. R topics documented: February 26, Type Package Title Crowd Sourced System Benchmarks Version 0.2.

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package rsppfp. November 20, 2018

Package rgdax. January 7, 2019

Package NFP. November 21, 2016

Package internetarchive

Package postal. July 27, 2018

Package RODBCext. July 31, 2017

Package bigqueryr. October 23, 2017

Package vinereg. August 10, 2018

Package rcmdcheck. R topics documented: November 10, 2018

Package reval. May 26, 2015

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package slickr. March 6, 2018

Package vip. June 15, 2018

Package rollply. R topics documented: August 29, Title Moving-Window Add-on for 'plyr' Version 0.5.0

Package meme. December 6, 2017

Package loggit. April 9, 2018

Package jpmesh. December 4, 2017

Package clipr. June 23, 2018

Package states. May 4, 2018

Transcription:

Type Package Title Perform and Display Google Trends Queries Version 1.4.2 Date 2018-08-03 Package gtrendsr August 4, 2018 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. License GPL (>= 2) BugReports https://github.com/pmassicotte/gtrendsr/issues URL https://github.com/pmassicotte/gtrendsr Depends R (>= 3.2.0) LazyData yes Imports ggplot2, jsonlite, anytime, curl RoxygenNote 6.1.0 Suggests knitr, rmarkdown Encoding UTF-8 NeedsCompilation no Author Philippe Massicotte [aut, cre], Dirk Eddelbuettel [aut] Maintainer Philippe Massicotte <pmassicotte@hotmail.com> Repository CRAN Date/Publication 2018-08-04 04:20:02 UTC R topics documented: categories.......................................... 2 countries........................................... 2 gtrends............................................ 3 plot.gtrends......................................... 5 sethandleparameters.................................... 6 1

2 countries Index 7 categories Google Trends categories. name Names of the categories id IDs of the categories data("categories") Format A data frame with 1426 rows and 2 variables countries Word countries ISO code. country_code Two-digits country codes description of the location sub_code ISO3166-2 country codes data("countries") Format A data frame with 122845 rows and 3 variables References http://www.unece.org/cefact/codesfortrade/codes_index.html

gtrends 3 gtrends Google Trends Query The gtrends default method performs a Google Trends query for the query argument and session session. Optional arguments for geolocation and category can also be supplied. gtrends(keyword = NA, geo = "", time = "today+5-y", gprop = c("web", "news", "images", "froogle", "youtube"), category = 0, hl = "en-us", low_search_volume = FALSE, cookie_url = "http://trends.google.com/cookies/nid") Arguments keyword geo time gprop A character vector with the actual Google Trends query keywords. Multiple keywords are possible using gtrends(c("nhl","nba", "MLB", "MLS")). A character vector denoting geographic regions for the query, default to all for global queries. Multiple regions are possible using gtrends("nhl", c("ca", "US")). A string specifying the time span of the query. Possible values are: "now 1-H" Last hour "now 4-H" Last four hours "now 1-d" Last day "now 7-d" Last seven days "today 1-m" Past 30 days "today 3-m" Past 90 days "today 12-m" Past 12 months "today+5-y" Last five years (default) "all" Since the beginning of Google Trends (2004) "Y-m-d Y-m-d" Time span between two dates (ex.: "2010-01-01 2010-04-03") A character string defining the Google product for which the trend query if preformed. Valid options are: "web" (default) "news" "images" "froogle" "youtube" category A character denoting the category, defaults to 0. hl A string specifying the ISO language code (ex.: en-us or fr ). Default is en-us. Note that this is only influencing the data returned by related topics.

4 gtrends Value low_search_volume Logical. Should include low search volume regions? cookie_url A string specifying the URL from which to obtain cookies. Default should work in general; should only be changed by advanced users. An object of class gtrends (basically a list of data frames). Categories The package includes a complete list of categories that can be used to narrow requests. These can be accessed using data("categories"). Related topics Note that *related topics* are not retrieved when more than one keyword is provided due to Google restriction. Examples ## 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

plot.gtrends 5 ## 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) ## End(Not run) plot.gtrends Plot Google Trends interest over time Plot Google Trends interest over time ## S3 method for class 'gtrends' plot(x,...) Arguments x A gtrends object.... Additional parameters passed on in method dispatch. Currently not used. Value A ggplot2 object is returned silently. Examples ## Not run: res <- gtrends("nhl", geo = c("ca", "US")) plot(res) ## End(Not run)

6 sethandleparameters sethandleparameters If gtrends should be used behind a proxy, especially with NTLM authentication mode, you need to set the proxy parameters and credentials using "sethandleparameters" function If gtrends should be used behind a proxy, especially with NTLM authentication mode, you need to set the proxy parameters and credentials using "sethandleparameters" function sethandleparameters(user = NULL, password = NULL, domain = NULL, proxyhost = NULL, proxyport = 8080, proxyauth = 15) Arguments user password domain proxyhost proxyport proxyauth A string specifying your username A string specifying your password A string specifying the authentication domain A string specifying the Proxy host DNS or IP address A numeric specifying the Proxy Port : 8080 (default) A numeric specifying the Proxy Authentication Method : 0 for NONE 1 for BASIC 2 for DIGEST 4 for NEGOTIATE 8 for NTLM 15 for ANY (default) Examples ## Not run: library(gtrendsr) sethandleparameters(user="xxxx",password="*******",domain="mydomain",proxyhost = "10.111.124.113") res <- gtrends(c("nhl", "nba"), geo = c("ca", "US")) ## End(Not run)

Index Topic datasets categories, 2 countries, 2 categories, 2 countries, 2 gtrends, 3, 5 plot.gtrends, 5 sethandleparameters, 6 7