Package gtrendsr. October 19, 2017

Similar documents
Package gtrendsr. August 4, 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 bisect. April 16, 2018

Package calpassapi. August 25, 2018

Package fastdummies. January 8, 2018

Package opencage. January 16, 2018

Package ECctmc. May 1, 2018

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

Package datasets.load

Package validara. October 19, 2017

Package facerec. May 14, 2018

Package TrafficBDE. March 1, 2018

Package messaging. May 27, 2018

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

Package WordR. September 7, 2017

Package repec. August 31, 2018

Package nlgeocoder. October 8, 2018

Package editdata. October 7, 2017

Package condusco. November 8, 2017

Package postgistools

Package kdtools. April 26, 2018

Package docxtools. July 6, 2018

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

Package wikitaxa. December 21, 2017

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

Package rzeit2. January 7, 2019

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

Package kirby21.base

Package GetITRData. October 22, 2017

Package balance. October 12, 2018

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

Package data.world. April 5, 2018

Package available. November 17, 2017

Package knitrprogressbar

Package canvasxpress

Package barcoder. October 26, 2018

Package aws.transcribe

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

Package fitbitscraper

Package jstree. October 24, 2017

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

Package githubinstall

Package weco. May 4, 2018

Package statsdk. September 30, 2017

Package QCAtools. January 3, 2017

Package spelling. December 18, 2017

Package spark. July 21, 2017

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

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package mdftracks. February 6, 2017

Package splithalf. March 17, 2018

Package effectr. January 17, 2018

Package ecoseries. R topics documented: September 27, 2017

Package internetarchive

Package patentsview. July 12, 2017

Package rgho. R topics documented: January 18, 2017

Package robotstxt. November 12, 2017

Package censusapi. August 19, 2018

Package fastqcr. April 11, 2017

Package shinyfeedback

Package projector. February 27, 2018

Package SNPediaR. April 9, 2019

Package omu. August 2, 2018

Package ASICS. January 23, 2018

Package goodpractice

Package cancensus. February 4, 2018

Package websearchr. R topics documented: October 23, 2018

Package queuecomputer

Package sigmanet. April 23, 2018

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

Package guardianapi. February 3, 2019

Package tidyimpute. March 5, 2018

Package raker. October 10, 2017

Package deductive. June 2, 2017

Package manet. September 19, 2017

Package rsppfp. November 20, 2018

Package NFP. November 21, 2016

Package sessioninfo. June 21, 2017

Package darksky. September 20, 2017

Package pdfetch. October 15, 2017

Package dbx. July 5, 2018

Package tm.plugin.lexisnexis

Package IATScore. January 10, 2018

Package widyr. August 14, 2017

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

Package RODBCext. July 31, 2017

Package slickr. March 6, 2018

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

Package crossrun. October 8, 2018

Package librarian. R topics documented:

Package geogrid. August 19, 2018

Package meme. December 6, 2017

Package reval. May 26, 2015

Package postal. July 27, 2018

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

Package preprosim. July 26, 2016

Package clipr. June 23, 2018

Package shinyhelper. June 21, 2018

Transcription:

Type Package Title Perform and Display Google Trends Queries Version 1.4.0 Date 2017-10-19 Package gtrendsr October 19, 2017 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.0) LazyData yes Imports ggplot2, jsonlite, anytime, curl RoxygenNote 6.0.1 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 2017-10-19 18:09:49 UTC R topics documented: categories.......................................... 2 countries........................................... 2 gtrends............................................ 3 plot.gtrends......................................... 5 Index 6 1

2 countries 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 89743 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, geo = "", time = "today+5-y", gprop = c("web", "news", "images", "froogle", "youtube"), category = 0, hl = "en-us") 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 Value 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. An object of class gtrends (basically a list of data frames).

4 gtrends 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) ## Sport category (20) data(categories) categories[grepl("^sport", categories$name), ] gtrends(c("nhl", "NFL"), geo = c("ca", "US"), 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)

plot.gtrends 5 ## 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 Value A gtrends object.... Additional parameters passed on in method dispatch. Currently not used. A ggplot2 object is returned silently. Examples ## Not run: res <- gtrends("nhl", geo = c("ca", "US")) plot(res) ## End(Not run)

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