├── .Rbuildignore ├── .gitignore ├── CRAN-RELEASE ├── DESCRIPTION ├── NAMESPACE ├── NEWS.md ├── R ├── get_trends.R ├── trendy.R └── zzz.R ├── README.md ├── cran-comments.md ├── man ├── get_interest.Rd ├── get_interest_city.Rd ├── get_interest_country.Rd ├── get_interest_dma.Rd ├── get_interest_region.Rd ├── get_related_queries.Rd ├── get_related_topics.Rd └── trendy.Rd ├── renv.lock ├── renv ├── .gitignore └── activate.R └── trendy.Rproj /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.Rproj$ 4 | ^gtrends\.R$ 5 | ^cran-comments\.md$ 6 | ^README\.md$ 7 | ^NEWS\.md$ 8 | ^CRAN-RELEASE$ 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | Rproj.user/89DECCC4/sources/ 3 | .Rhistory 4 | .RData 5 | examples 6 | CRAN-RELEASE 7 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2019-05-09. 2 | Once it is accepted, delete this file and tag the release (commit fbb973f6aa). 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: trendyy 2 | Title: A Tidy Wrapper Around 'gtrendsR' 3 | Version: 0.1.1 4 | Date: 2019-05-19 5 | Authors@R: c( 6 | person("Josiah", "Parry", email = "josiah.parry@gmail.com", role = c("aut", "cre")) 7 | ) 8 | Maintainer: Josiah Parry 9 | Description: Access Google Trends information. This package provides a tidy wrapper to the 'gtrendsR' package. 10 | Use four spaces when indenting paragraphs within the Description. 11 | License: GPL-2 12 | Encoding: UTF-8 13 | URL: https://github.com/josiahparry/trendyy 14 | BugReports: https://github.com/josiahparry/trendyy/issues 15 | Depends: 16 | R (>= 3.2.0) 17 | Imports: 18 | gtrendsR, 19 | magrittr, 20 | dplyr, 21 | purrr, 22 | crayon, 23 | stringr, 24 | tibble 25 | RoxygenNote: 6.1.1 26 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(print,trendy) 4 | export(get_interest) 5 | export(get_interest_city) 6 | export(get_interest_country) 7 | export(get_interest_dma) 8 | export(get_interest_region) 9 | export(get_related_queries) 10 | export(get_related_topics) 11 | export(trendy) 12 | importFrom(crayon,bold) 13 | importFrom(dplyr,group_by) 14 | importFrom(dplyr,left_join) 15 | importFrom(dplyr,mutate) 16 | importFrom(dplyr,pull) 17 | importFrom(dplyr,rename) 18 | importFrom(dplyr,select) 19 | importFrom(dplyr,summarise) 20 | importFrom(gtrendsR,gtrends) 21 | importFrom(magrittr,"%>%") 22 | importFrom(purrr,map) 23 | importFrom(purrr,map_chr) 24 | importFrom(purrr,map_dfr) 25 | importFrom(purrr,pluck) 26 | importFrom(stringr,str_extract) 27 | importFrom(tibble,as_tibble) 28 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | ## News 2 | 3 | May 19th, 2019 4 | 5 | Version Bumped to 0.1.1 6 | 7 | * Added error handling to accessor functions 8 | * Ensuring that `hits` column is always integer class 9 | * Fixed broken `print.trendy` method 10 | 11 | May 15th, 2019 12 | 13 | * `trendyy` is available on CRAN. With broken print method. Still works. 14 | 15 | 16 | May 9th, 2019 17 | 18 | * Submitting trendy to CRAN 19 | -------------------------------------------------------------------------------- /R/get_trends.R: -------------------------------------------------------------------------------- 1 | if(getRversion() >= "2.15.1") { 2 | 3 | utils::globalVariables(c("category", "hits", "id", "keyword", "name", "pull")) 4 | } 5 | 6 | #' Retrieve related queries 7 | #' 8 | #' Extract tibble of related queries from trendy object 9 | #' @param trendy An object of class trendy created via \code{trendy()} 10 | #' 11 | #' @export 12 | #' @importFrom purrr map_dfr pluck 13 | #' @importFrom dplyr mutate rename select left_join 14 | #' @importFrom stringr str_extract 15 | #' @importFrom tibble as_tibble 16 | #' @importFrom magrittr %>% 17 | #' 18 | #' @examples 19 | #' \dontrun{ 20 | #' ob <- trendy("obama") 21 | #' get_related_queries(ob) 22 | #' } 23 | #' 24 | #' @return A tibble containing related search terms 25 | get_related_queries <- function(trendy) { 26 | 27 | if (is.null(pluck(trendy[[1]], "related_queries"))) { 28 | stop("No related queries") 29 | } 30 | 31 | map_dfr(trendy, pluck("related_queries")) %>% 32 | left_join(mutate(gtrendsR::categories, id = as.integer(id)), 33 | by = c("category" = "id")) %>% 34 | select(-category) %>% 35 | rename(category = name) %>% 36 | as_tibble() %>% 37 | return() 38 | } 39 | 40 | 41 | 42 | 43 | #' Retrieve related topics 44 | #' 45 | #' Extract a tibble of related topics from trendy object 46 | #' @param trendy An object of class trendy created via \code{trendy()} 47 | #' 48 | #' @export 49 | #' @importFrom purrr map_dfr pluck 50 | #' @importFrom dplyr mutate rename select left_join 51 | #' @importFrom stringr str_extract 52 | #' @importFrom tibble as_tibble 53 | #' @importFrom magrittr %>% 54 | #' @examples 55 | #' \dontrun{ 56 | #' ob <- trendy("obama") 57 | #' get_related_topics(ob) 58 | #' } 59 | #' 60 | get_related_topics <- function(trendy) { 61 | 62 | if (is.null(pluck(trendy[[1]], "related_topics"))) { 63 | stop("No related topics") 64 | } 65 | 66 | map_dfr(trendy, pluck("related_topics")) %>% 67 | left_join(mutate(gtrendsR::categories, id = as.integer(id)), 68 | by = c("category" = "id")) %>% 69 | select(-category) %>% 70 | rename(category = name) %>% 71 | as_tibble() %>% 72 | return() 73 | } 74 | 75 | 76 | 77 | #' Retrieve interest over time 78 | #' 79 | #' Extract a tibble of interest over time 80 | #' @param trendy An object of class trendy created via \code{trendy()} 81 | #' 82 | #' @export 83 | #' @importFrom purrr map_dfr pluck 84 | #' @importFrom dplyr mutate rename select left_join 85 | #' @importFrom stringr str_extract 86 | #' @importFrom tibble as_tibble 87 | #' @importFrom magrittr %>% 88 | #' @examples 89 | #' \dontrun{ 90 | #' ob <- trendy("obama") 91 | #' get_interest(ob) 92 | #' } 93 | #' 94 | get_interest <- function(trendy) { 95 | 96 | if (is.null(pluck(trendy[[1]], "interest_over_time"))) { 97 | stop("No interest over time data") 98 | } 99 | 100 | map_dfr(.x = trendy, ~pluck(.x, "interest_over_time") %>% 101 | mutate(hits = str_extract(hits, "[0-9]+"))) %>% 102 | left_join(mutate(gtrendsR::categories, id = as.integer(id)), 103 | by = c("category" = "id")) %>% 104 | select(-category) %>% 105 | rename(category = name) %>% 106 | as_tibble() %>% 107 | mutate(hits = as.integer(hits)) 108 | } 109 | 110 | 111 | #' Retrieve interest by city 112 | #' 113 | #' Extract a tibble of interest by city from trendy object 114 | #' @param trendy An object of class trendy created via \code{trendy()} 115 | #' 116 | #' @export 117 | #' @importFrom purrr map_dfr pluck 118 | #' @importFrom tibble as_tibble 119 | #' @importFrom dplyr mutate 120 | #' @importFrom magrittr %>% 121 | #' @examples 122 | #' \dontrun{ 123 | #' ob <- trendy("obama") 124 | #' get_interest_city(ob) 125 | #' } 126 | #' 127 | get_interest_city <- function(trendy) { 128 | 129 | if (is.null(pluck(trendy[[1]], "interest_by_city"))) { 130 | stop("No interest by city data") 131 | } 132 | 133 | map_dfr(trendy, pluck("interest_by_city")) %>% 134 | as_tibble() %>% 135 | mutate(hits = as.integer(hits)) 136 | } 137 | 138 | #' Retrieve interest by country 139 | #' 140 | #' Extract a tibble of interest by country from trendy object 141 | #' @param trendy An object of class trendy created via \code{trendy()} 142 | #' 143 | #' @export 144 | #' @importFrom purrr map_dfr pluck 145 | #' @importFrom tibble as_tibble 146 | #' @importFrom dplyr mutate 147 | #' @importFrom magrittr %>% 148 | #' @examples 149 | #' \dontrun{ 150 | #' ob <- trendy("obama") 151 | #' get_interest_country(ob) 152 | #' } 153 | #' 154 | get_interest_country <- function(trendy) { 155 | 156 | if (is.null(pluck(trendy[[1]], "interest_by_country"))) { 157 | stop("No interest by country data") 158 | } 159 | 160 | map_dfr(trendy, pluck("interest_by_country")) %>% 161 | as_tibble() %>% 162 | mutate(hits = as.integer(hits)) 163 | } 164 | 165 | 166 | #' Retrieve interest by DMA 167 | #' 168 | #' Extract a tibble of interest by DMA from trendy object 169 | #' @param trendy An object of class trendy created via \code{trendy()} 170 | #' 171 | #' @export 172 | #' @importFrom purrr map_dfr pluck 173 | #' @importFrom dplyr mutate 174 | #' @importFrom tibble as_tibble 175 | #' @importFrom magrittr %>% 176 | #' @examples 177 | #' \dontrun{ 178 | #' ob <- trendy("obama") 179 | #' get_interest_dma(ob) 180 | #' } 181 | #' 182 | get_interest_dma <- function(trendy) { 183 | 184 | if (is.null(pluck(trendy[[1]], "interest_by_dma"))) { 185 | stop("No interest by DMA data") 186 | } 187 | 188 | map_dfr(trendy, pluck("interest_by_dma")) %>% 189 | as_tibble() %>% 190 | mutate(hits = as.integer(hits)) 191 | } 192 | 193 | 194 | #' Retrieve interest by region 195 | #' 196 | #' Extract a tibble of interest by region from trendy object 197 | #' @param trendy An object of class trendy created via \code{trendy()} 198 | #' 199 | #' @export 200 | #' @importFrom purrr map_dfr pluck 201 | #' @importFrom dplyr mutate 202 | #' @importFrom tibble as_tibble 203 | #' @importFrom magrittr %>% 204 | #' @examples 205 | #' \dontrun{ 206 | #' ob <- trendy("obama") 207 | #' get_interest_region(ob) 208 | #' } 209 | 210 | get_interest_region <- function(trendy) { 211 | 212 | if (is.null(pluck(trendy[[1]], "interest_by_region"))) { 213 | stop("No interest by region data") 214 | } 215 | 216 | map_dfr(trendy, pluck("interest_by_region")) %>% 217 | as_tibble() %>% 218 | mutate(hits = as.integer(hits)) 219 | } 220 | -------------------------------------------------------------------------------- /R/trendy.R: -------------------------------------------------------------------------------- 1 | #' Google Trends Search 2 | #' 3 | #' Search Google Trends to retrieve relative hits and popularity. This supports comparison of up to 5 search terms. Anything more than that will be searched individually. 4 | #' 5 | #' @param search_terms A character vector containing the search terms of interest 6 | #' @param from The beginning date of the query 7 | #' @param to The beginning date of the query 8 | #' @param ... arguments passed to \code{gtrendsR::gtrends()}. See ?gtrendsR::gtrends for more information including geography, language, and time-zone. 9 | #' 10 | #' @export 11 | #' @importFrom purrr map map_chr pluck 12 | #' @importFrom dplyr group_by summarise 13 | #' @importFrom crayon bold 14 | #' @importFrom magrittr %>% 15 | #' @importFrom gtrendsR gtrends 16 | #' @return An object of class `trendy` 17 | #' 18 | #' @examples 19 | #' \dontrun{ 20 | #' trendy("RStudio 1.2") 21 | #' } 22 | #' 23 | 24 | trendy <- function(search_terms, from = NA, to = NA, ...) { 25 | 26 | if (!all(is.na(from), is.na(to))) { 27 | time <- paste(from, to, sep = " ") 28 | } else { 29 | time <- "today+5-y" 30 | } 31 | 32 | 33 | if (length(search_terms) <= 5) { 34 | searched_trends <- gtrendsR::gtrends(search_terms, time = time, ...) %>% 35 | list() 36 | } else { 37 | searched_trends <- search_terms %>% 38 | map(gtrendsR::gtrends, time = time, ...) 39 | } 40 | 41 | 42 | 43 | structure( 44 | searched_trends, 45 | class = "trendy" 46 | ) 47 | 48 | } 49 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | #' Create print method for trendy object 2 | #' @name trendy 3 | #' @param x trendy object 4 | #' @importFrom dplyr pull group_by summarise 5 | #' @export 6 | print.trendy <- function(x, ...) { 7 | cat((crayon::bold("~Trendy results~\n"))) 8 | cat("\nSearch Terms: ") 9 | cat(paste(get_interest(x) %>% 10 | dplyr::pull(keyword) %>% 11 | unique(), 12 | sep = " "), sep = ", ") 13 | cat("\n\n(>^.^)> ~~~~~~~~~~~~~~~~~~~~ summary ~~~~~~~~~~~~~~~~~~~~ <(^.^<)\n") 14 | print(x %>% 15 | get_interest() %>% 16 | group_by(keyword) %>% 17 | summarise(max_hits = max(hits), 18 | min_hits = min(hits), 19 | from = as.Date(min(date)), 20 | to = as.Date(max(date)))) 21 | invisible(x) 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) 3 | 4 | 5 |

~trendyy~

6 | 7 |

(>^.^)> ~ Tidy Access to Google Trends ~ <(^.^<)

8 | 9 | `trendyy` is a package to provide a tidy interface to the [`gtrendsR`](https://github.com/PMassicotte/gtrendsR) package by [Philippe Massicotte](http://www.pmassicotte.com/). 10 | 11 | The idea was to provide an interface to the package that is `tibble` friendly. This package provides accessor functions to the various data frames that `gtrendsR` provides. 12 | 13 | ### Usage: 14 | 15 | `trendy()` enables you to query Google Trends. The only required argument is `search_terms`. If you submit 5 or few search terms as a character vector, the terms will be compared to eachother. If more than 5 terms are submitted, each will be qeuried on it's own. 16 | 17 | Optionally, you can provide a desired date range in the format of `"YYYY-MM-DD"` to the `from` and `to` arguments. Other arguments that are passed to `gtrendsR::gtrends()` are also valid, including the `time` argument. 18 | 19 | `trendy()` returns an object of class `trendy`. To access the tables, use any of the accessor functions below: 20 | 21 | - `get_interest()`: trends over time 22 | - `get_interest_city()`: trends by city 23 | - `get_interest_country()`: trends by country 24 | - `get_interest_dma()`: trends for a designated marketing area 25 | - `get_interest_region()`: trends by region 26 | - `get_related_queries()`: related search phrases 27 | - `get_related_topics()`: related topics 28 | 29 | 30 | ### Example: 31 | 32 | ``` 33 | library(trendyy) 34 | library(dplyr) 35 | 36 | 37 | 38 | ob <- trendy("Obama", 39 | from = Sys.Date() - 365, 40 | to = Sys.Date()) %>% 41 | get_interest() 42 | ``` 43 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | * local OS X install, R 3.5.3 3 | * ubuntu 14.04 (on travis-ci), R 3.5.3 4 | * win-builder (devel and release) 5 | 6 | ## R CMD check results 7 | 8 | 0 errors | 0 warnings | 1 note 9 | 10 | * This is a new release. 11 | 12 | ## Resubmission 13 | 14 | Existing namespace conflict with Bioconductor. 15 | 16 | Renamed to `trendyy`. 17 | -------------------------------------------------------------------------------- /man/get_interest.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_interest} 4 | \alias{get_interest} 5 | \title{Retrieve interest over time} 6 | \usage{ 7 | get_interest(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of interest over time 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_interest(ob) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/get_interest_city.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_interest_city} 4 | \alias{get_interest_city} 5 | \title{Retrieve interest by city} 6 | \usage{ 7 | get_interest_city(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of interest by city from trendy object 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_interest_city(ob) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/get_interest_country.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_interest_country} 4 | \alias{get_interest_country} 5 | \title{Retrieve interest by country} 6 | \usage{ 7 | get_interest_country(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of interest by country from trendy object 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_interest_country(ob) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/get_interest_dma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_interest_dma} 4 | \alias{get_interest_dma} 5 | \title{Retrieve interest by DMA} 6 | \usage{ 7 | get_interest_dma(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of interest by DMA from trendy object 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_interest_dma(ob) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/get_interest_region.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_interest_region} 4 | \alias{get_interest_region} 5 | \title{Retrieve interest by region} 6 | \usage{ 7 | get_interest_region(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of interest by region from trendy object 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_interest_region(ob) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /man/get_related_queries.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_related_queries} 4 | \alias{get_related_queries} 5 | \title{Retrieve related queries} 6 | \usage{ 7 | get_related_queries(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \value{ 13 | A tibble containing related search terms 14 | } 15 | \description{ 16 | Extract tibble of related queries from trendy object 17 | } 18 | \examples{ 19 | \dontrun{ 20 | ob <- trendy("obama") 21 | get_related_queries(ob) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/get_related_topics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_trends.R 3 | \name{get_related_topics} 4 | \alias{get_related_topics} 5 | \title{Retrieve related topics} 6 | \usage{ 7 | get_related_topics(trendy) 8 | } 9 | \arguments{ 10 | \item{trendy}{An object of class trendy created via \code{trendy()}} 11 | } 12 | \description{ 13 | Extract a tibble of related topics from trendy object 14 | } 15 | \examples{ 16 | \dontrun{ 17 | ob <- trendy("obama") 18 | get_related_topics(ob) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/trendy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/trendy.R, R/zzz.R 3 | \name{trendy} 4 | \alias{trendy} 5 | \alias{print.trendy} 6 | \title{Google Trends Search} 7 | \usage{ 8 | trendy(search_terms, from = NA, to = NA, ...) 9 | 10 | \method{print}{trendy}(x, ...) 11 | } 12 | \arguments{ 13 | \item{search_terms}{A character vector containing the search terms of interest} 14 | 15 | \item{from}{The beginning date of the query} 16 | 17 | \item{to}{The beginning date of the query} 18 | 19 | \item{...}{arguments passed to \code{gtrendsR::gtrends()}. See ?gtrendsR::gtrends for more information including geography, language, and time-zone.} 20 | 21 | \item{x}{trendy object} 22 | } 23 | \value{ 24 | An object of class `trendy` 25 | } 26 | \description{ 27 | Search Google Trends to retrieve relative hits and popularity. This supports comparison of up to 5 search terms. Anything more than that will be searched individually. 28 | } 29 | \examples{ 30 | \dontrun{ 31 | trendy("RStudio 1.2") 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /renv.lock: -------------------------------------------------------------------------------- 1 | [renv] 2 | Version=0.4.0-21 3 | 4 | [R] 5 | Version=3.5.3 6 | Repositories= 7 | CRAN=https://cran.rstudio.com/ 8 | 9 | [R/Package/BH] 10 | Package=BH 11 | Version=1.69.0-1 12 | Source=CRAN 13 | Hash=c21ff57827acd7a1e150943fa1264677 14 | 15 | [R/Package/MASS] 16 | Package=MASS 17 | Version=7.3-51.1 18 | Source=CRAN 19 | Hash=bafa10bf20a0212fb5dcf297feca0a5b 20 | 21 | [R/Package/Matrix] 22 | Package=Matrix 23 | Version=1.2-15 24 | Source=CRAN 25 | Hash=3f14dad0b07de3177209b666c6835170 26 | 27 | [R/Package/R6] 28 | Package=R6 29 | Version=2.4.0 30 | Source=CRAN 31 | Hash=f542e196103d43e270c2f12769143a4c 32 | 33 | [R/Package/RApiDatetime] 34 | Package=RApiDatetime 35 | Version=0.0.4 36 | Source=CRAN 37 | Hash=a70019822c12f812cb09ebd6153d3220 38 | 39 | [R/Package/RColorBrewer] 40 | Package=RColorBrewer 41 | Version=1.1-2 42 | Source=CRAN 43 | Hash=e12d9efbd8540624beb948405e496adf 44 | 45 | [R/Package/Rcpp] 46 | Package=Rcpp 47 | Version=1.0.1 48 | Source=CRAN 49 | Hash=afc83bf2a529ebac3a0ac6434772b1c7 50 | 51 | [R/Package/anytime] 52 | Package=anytime 53 | Version=0.3.3 54 | Source=CRAN 55 | Hash=3c492c54da891879a447f7e52f20a2db 56 | 57 | [R/Package/askpass] 58 | Package=askpass 59 | Version=1.1 60 | Source=CRAN 61 | Hash=8cf7584c364ebfbd3b84154a0fd0c18d 62 | 63 | [R/Package/assertthat] 64 | Package=assertthat 65 | Version=0.2.1 66 | Source=CRAN 67 | Hash=2247b53bdc6a80930cc84f85fb0d04e1 68 | 69 | [R/Package/backports] 70 | Package=backports 71 | Version=1.1.4 72 | Source=CRAN 73 | Hash=41bcc4f617da2138bedeab2949b22319 74 | 75 | [R/Package/brew] 76 | Package=brew 77 | Version=1.0-6 78 | Source=CRAN 79 | Hash=83a95e35c28b386681e1a05f29fae496 80 | 81 | [R/Package/callr] 82 | Package=callr 83 | Version=3.2.0 84 | Source=CRAN 85 | Hash=0b7fee40594a684a5c3f31f94fd7221f 86 | 87 | [R/Package/cli] 88 | Package=cli 89 | Version=1.1.0 90 | Source=CRAN 91 | Hash=eedaa1f888777090cdd93d19cb42fdca 92 | 93 | [R/Package/clipr] 94 | Package=clipr 95 | Version=0.5.0 96 | Source=CRAN 97 | Hash=6d37660014ff66d19b851125c312ea33 98 | 99 | [R/Package/clisymbols] 100 | Package=clisymbols 101 | Version=1.2.0 102 | Source=CRAN 103 | Hash=7d795ad90c9503c6d0e35c8ff2511a21 104 | 105 | [R/Package/colorspace] 106 | Package=colorspace 107 | Version=1.4-1 108 | Source=CRAN 109 | Hash=705e3eac14c352ff8250ec9c7481c33d 110 | 111 | [R/Package/commonmark] 112 | Package=commonmark 113 | Version=1.7 114 | Source=CRAN 115 | Hash=1292628dbd656fd28597cc9c8050333f 116 | 117 | [R/Package/crayon] 118 | Package=crayon 119 | Version=1.3.4 120 | Source=CRAN 121 | Hash=84467438184915ca5bbf3279e1a56b44 122 | 123 | [R/Package/curl] 124 | Package=curl 125 | Version=3.3 126 | Source=CRAN 127 | Hash=aaea072ce2cf5f388446650b475874a8 128 | 129 | [R/Package/desc] 130 | Package=desc 131 | Version=1.2.0 132 | Source=CRAN 133 | Hash=d033d9c9763edc1982c096a91dba894f 134 | 135 | [R/Package/devtools] 136 | Package=devtools 137 | Version=2.0.2 138 | Source=CRAN 139 | Hash=8f5de6298ce595a8b08a2308d7ce16aa 140 | 141 | [R/Package/digest] 142 | Package=digest 143 | Version=0.6.18 144 | Source=CRAN 145 | Hash=3a0646cd1e9116f7bf03ca88e1e562f8 146 | 147 | [R/Package/dplyr] 148 | Package=dplyr 149 | Version=0.8.0.1 150 | Source=CRAN 151 | Hash=7b837a44bdd180ba9ca48274b901e786 152 | 153 | [R/Package/fansi] 154 | Package=fansi 155 | Version=0.4.0 156 | Source=CRAN 157 | Hash=ed266fd17df944c53786d83841c4770f 158 | 159 | [R/Package/fs] 160 | Package=fs 161 | Version=1.2.7 162 | Source=CRAN 163 | Hash=ed5748fb017dc518db34c3273d16d228 164 | 165 | [R/Package/ggplot2] 166 | Package=ggplot2 167 | Version=3.1.1 168 | Source=CRAN 169 | Hash=697553cc988603532e9800d36a58de41 170 | 171 | [R/Package/gh] 172 | Package=gh 173 | Version=1.0.1 174 | Source=CRAN 175 | Hash=35644e3625636e3508bf03ad7aec9d9c 176 | 177 | [R/Package/git2r] 178 | Package=git2r 179 | Version=0.25.2 180 | Source=CRAN 181 | Hash=f6e8b123dc9e80e5110bb53d15dd4689 182 | 183 | [R/Package/glue] 184 | Package=glue 185 | Version=1.3.1 186 | Source=CRAN 187 | Hash=9611ef23b274cfa43c85839a183948dc 188 | 189 | [R/Package/gtable] 190 | Package=gtable 191 | Version=0.3.0 192 | Source=CRAN 193 | Hash=a20c2bde56b0b3a359ec5e46df1f70af 194 | 195 | [R/Package/gtrendsR] 196 | Package=gtrendsR 197 | Version=1.4.3 198 | Source=GitHub 199 | RemoteType=github 200 | RemoteHost=api.github.com 201 | RemoteRepo=gtrendsR 202 | RemoteUsername=PMassicotte 203 | RemoteRef=master 204 | RemoteSha=e67e00f75eeae7625eeecc11dfccb0b5ae0a2ed6 205 | Hash=6f497118d20192dd4e860be5bcfd5629 206 | 207 | [R/Package/httr] 208 | Package=httr 209 | Version=1.4.0 210 | Source=CRAN 211 | Hash=dacc39276974a4b2342659368a7b623b 212 | 213 | [R/Package/ini] 214 | Package=ini 215 | Version=0.3.1 216 | Source=CRAN 217 | Hash=baac21286fd4364616bd5d380ed9884d 218 | 219 | [R/Package/jsonlite] 220 | Package=jsonlite 221 | Version=1.6 222 | Source=CRAN 223 | Hash=9098f8f59907a1180f3a2ff469cd67f2 224 | 225 | [R/Package/labeling] 226 | Package=labeling 227 | Version=0.3 228 | Source=CRAN 229 | Hash=701b56435d3771d042b816ff1abb9944 230 | 231 | [R/Package/lattice] 232 | Package=lattice 233 | Version=0.20-38 234 | Source=CRAN 235 | Hash=ab950ea929b83c44eeba6ce00e280f9a 236 | 237 | [R/Package/lazyeval] 238 | Package=lazyeval 239 | Version=0.2.2 240 | Source=CRAN 241 | Hash=a230d72a95d16715973ad2ae0664cfc0 242 | 243 | [R/Package/magrittr] 244 | Package=magrittr 245 | Version=1.5 246 | Source=CRAN 247 | Hash=1063976a6affe09eb75fc2927b8d4d9d 248 | 249 | [R/Package/memoise] 250 | Package=memoise 251 | Version=1.1.0 252 | Source=CRAN 253 | Hash=69e69a93c4521440b176fa74be579356 254 | 255 | [R/Package/mgcv] 256 | Package=mgcv 257 | Version=1.8-27 258 | Source=CRAN 259 | Hash=0a4766473f879000321f7826f52d0309 260 | 261 | [R/Package/mime] 262 | Package=mime 263 | Version=0.6 264 | Source=CRAN 265 | Hash=976803fdcdc85d33c36218b44156e1c1 266 | 267 | [R/Package/munsell] 268 | Package=munsell 269 | Version=0.5.0 270 | Source=CRAN 271 | Hash=504a3c6bd8b5b9c1f4dd9065ead25c9a 272 | 273 | [R/Package/nlme] 274 | Package=nlme 275 | Version=3.1-137 276 | Source=CRAN 277 | Hash=7467c94bb956dbfe03f05ceb944d18f4 278 | 279 | [R/Package/openssl] 280 | Package=openssl 281 | Version=1.3 282 | Source=CRAN 283 | Hash=54c10fdc44f59c4a2ee530ff8bc0073b 284 | 285 | [R/Package/pillar] 286 | Package=pillar 287 | Version=1.3.1 288 | Source=CRAN 289 | Hash=047950e50e884512870c52c21e9317cd 290 | 291 | [R/Package/pkgbuild] 292 | Package=pkgbuild 293 | Version=1.0.3 294 | Source=CRAN 295 | Hash=5b0f611ba54b48dc4855800ded2b401e 296 | 297 | [R/Package/pkgconfig] 298 | Package=pkgconfig 299 | Version=2.0.2 300 | Source=CRAN 301 | Hash=cb8f27ad9e671904636c04acd56131f0 302 | 303 | [R/Package/pkgload] 304 | Package=pkgload 305 | Version=1.0.2 306 | Source=CRAN 307 | Hash=05fc6d91ef1820c65c961696fb90ef4c 308 | 309 | [R/Package/plogr] 310 | Package=plogr 311 | Version=0.2.0 312 | Source=CRAN 313 | Hash=a99927b0b9c09008dd207da128bb050f 314 | 315 | [R/Package/plyr] 316 | Package=plyr 317 | Version=1.8.4 318 | Source=CRAN 319 | Hash=22a149ed250857f9159e7ed078ea94a6 320 | 321 | [R/Package/prettyunits] 322 | Package=prettyunits 323 | Version=1.0.2 324 | Source=CRAN 325 | Hash=d6f0227d29f17a4a8a73bbad025adab5 326 | 327 | [R/Package/processx] 328 | Package=processx 329 | Version=3.3.0 330 | Source=CRAN 331 | Hash=c5f4e7f2fd295a31f1e3b752b0e7b01c 332 | 333 | [R/Package/ps] 334 | Package=ps 335 | Version=1.3.0 336 | Source=CRAN 337 | Hash=4a21b2c9033d140e122ed23d16592f22 338 | 339 | [R/Package/purrr] 340 | Package=purrr 341 | Version=0.3.2 342 | Source=CRAN 343 | Hash=27e0729a3fe0e9a66f6a53f677dda4f8 344 | 345 | [R/Package/rcmdcheck] 346 | Package=rcmdcheck 347 | Version=1.3.2.9002 348 | Source=GitHub 349 | RemoteType=github 350 | RemoteHost=api.github.com 351 | RemoteRepo=rcmdcheck 352 | RemoteUsername=r-lib 353 | RemoteRef=master 354 | RemoteSha=941d5c4d312746933f2e1b1326244daf41e46b89 355 | Hash=3fdf020a61ca982e579b41d76df7fb25 356 | 357 | [R/Package/remotes] 358 | Package=remotes 359 | Version=2.0.4 360 | Source=CRAN 361 | Hash=b5994712edfbb584bfe1828a1706a7d0 362 | 363 | [R/Package/reshape2] 364 | Package=reshape2 365 | Version=1.4.3 366 | Source=CRAN 367 | Hash=431389bf4e0708ebafb1dec474f3cba8 368 | 369 | [R/Package/rlang] 370 | Package=rlang 371 | Version=0.3.4 372 | Source=CRAN 373 | Hash=11a12baf65c41f898629886455ddebd0 374 | 375 | [R/Package/roxygen2] 376 | Package=roxygen2 377 | Version=6.1.1 378 | Source=CRAN 379 | Hash=1f89f067e58d62d462b38e098fdff8b6 380 | 381 | [R/Package/rprojroot] 382 | Package=rprojroot 383 | Version=1.3-2 384 | Source=CRAN 385 | Hash=e6c60a758ed15027bf9ba44701d2e01d 386 | 387 | [R/Package/rstudioapi] 388 | Package=rstudioapi 389 | Version=0.10 390 | Source=CRAN 391 | Hash=7017924bdb0eb5bc313f4dae2352e65a 392 | 393 | [R/Package/scales] 394 | Package=scales 395 | Version=1.0.0 396 | Source=CRAN 397 | Hash=55f0078e1e49c799686b5cb57f886087 398 | 399 | [R/Package/sessioninfo] 400 | Package=sessioninfo 401 | Version=1.1.1 402 | Source=CRAN 403 | Hash=c756eca9ff3fa1036cda98ac151e8387 404 | 405 | [R/Package/stringi] 406 | Package=stringi 407 | Version=1.4.3 408 | Source=CRAN 409 | Hash=173c63cf8b9f876dba8b2984ce7a65d7 410 | 411 | [R/Package/stringr] 412 | Package=stringr 413 | Version=1.4.0 414 | Source=CRAN 415 | Hash=813b06afd70ca31c1071395d49346b89 416 | 417 | [R/Package/sys] 418 | Package=sys 419 | Version=3.2 420 | Source=CRAN 421 | Hash=fbd1f0866d1755b814c741006ef39a44 422 | 423 | [R/Package/tibble] 424 | Package=tibble 425 | Version=2.1.1 426 | Source=CRAN 427 | Hash=7731263493ca3f1c7c868e7bfb5d92aa 428 | 429 | [R/Package/tidyselect] 430 | Package=tidyselect 431 | Version=0.2.5 432 | Source=CRAN 433 | Hash=40aceb5150e00cfe7a4999b4672cf614 434 | 435 | [R/Package/usethis] 436 | Package=usethis 437 | Version=1.5.0 438 | Source=CRAN 439 | Hash=cc84bf24bd03961a3333981a8270d85d 440 | 441 | [R/Package/utf8] 442 | Package=utf8 443 | Version=1.1.4 444 | Source=CRAN 445 | Hash=6399c80981358af7b39c217c72f22785 446 | 447 | [R/Package/viridisLite] 448 | Package=viridisLite 449 | Version=0.3.0 450 | Source=CRAN 451 | Hash=732c3dabc42bce1fafb5d286184804c6 452 | 453 | [R/Package/whisker] 454 | Package=whisker 455 | Version=0.3-2 456 | Source=CRAN 457 | Hash=cf13162701dd6681e36c1ea115deb545 458 | 459 | [R/Package/withr] 460 | Package=withr 461 | Version=2.1.2 462 | Source=CRAN 463 | Hash=844aae4b78fac8f6ed2541cde1facdb3 464 | 465 | [R/Package/xml2] 466 | Package=xml2 467 | Version=1.2.0 468 | Source=CRAN 469 | Hash=db809854a56ab0487ae935259e53a631 470 | 471 | [R/Package/xopen] 472 | Package=xopen 473 | Version=1.0.0 474 | Source=CRAN 475 | Hash=cd708a0f4e3f7b00fc7937e4dbe4c6d6 476 | 477 | [R/Package/yaml] 478 | Package=yaml 479 | Version=2.2.0 480 | Source=CRAN 481 | Hash=9db4f908886820b37f76b5ecc52c76e6 482 | 483 | -------------------------------------------------------------------------------- /renv/.gitignore: -------------------------------------------------------------------------------- 1 | library/ 2 | python/ 3 | -------------------------------------------------------------------------------- /renv/activate.R: -------------------------------------------------------------------------------- 1 | 2 | local({ 3 | 4 | # the requested version of renv 5 | version <- "0.4.0-21" 6 | 7 | # load the 'utils' package eagerly -- this ensures that renv shims, which 8 | # mask 'utils' packages, will come first on the search path 9 | library(utils, lib.loc = .Library) 10 | 11 | # check to see if renv has already been loaded 12 | if ("renv" %in% loadedNamespaces()) { 13 | 14 | # if renv has already been loaded, and it's the requested version of renv, 15 | # nothing to do 16 | spec <- .getNamespaceInfo(.getNamespace("renv"), "spec") 17 | if (identical(spec$version, version)) 18 | return(invisible(TRUE)) 19 | 20 | # otherwise, unload and attempt to load the correct version of renv 21 | unloadNamespace("renv") 22 | 23 | } 24 | 25 | # source the user profile if any, respecting R_PROFILE_USER 26 | profile <- Sys.getenv("R_PROFILE_USER", unset = path.expand("~/.Rprofile")) 27 | if (file.exists(profile)) { 28 | current <- normalizePath(".Rprofile", winslash = "/", mustWork = FALSE) 29 | if (!identical(profile, current)) 30 | source(profile) 31 | } 32 | 33 | # figure out root for renv installation 34 | default <- switch( 35 | Sys.info()[["sysname"]], 36 | Darwin = Sys.getenv("XDG_DATA_HOME", "~/Library/Application Support"), 37 | Windows = Sys.getenv("LOCALAPPDATA", "~/.renv"), 38 | Sys.getenv("XDG_DATA_HOME", "~/.local/share") 39 | ) 40 | 41 | base <- Sys.getenv("RENV_PATHS_ROOT", unset = file.path(default, "renv")) 42 | rversion <- paste("R", getRversion()[1, 1:2], sep = "-") 43 | path <- file.path(base, "bootstrap", rversion, R.version$platform, "renv", version) 44 | 45 | # try to load renv from one of these paths 46 | if (requireNamespace("renv", lib.loc = path, quietly = TRUE)) 47 | return(renv::load()) 48 | 49 | # failed to find renv locally; we'll try to install from GitHub. 50 | # first, set up download options as appropriate (try to use GITHUB_PAT) 51 | try({ 52 | 53 | message("Failed to find installation of renv -- attempting to bootstrap...") 54 | 55 | # ensure .Rprofile doesn't get executed 56 | rpu <- Sys.getenv("R_PROFILE_USER", unset = NA) 57 | Sys.setenv(R_PROFILE_USER = "") 58 | on.exit({ 59 | if (is.na(rpu)) 60 | Sys.unsetenv("R_PROFILE_USER") 61 | else 62 | Sys.setenv(R_PROFILE_USER = rpu) 63 | }, add = TRUE) 64 | 65 | # prepare download options 66 | pat <- Sys.getenv("GITHUB_PAT") 67 | if (nzchar(Sys.which("curl")) && nzchar(pat)) { 68 | fmt <- "--location --fail --header \"Authorization: token %s\"" 69 | extra <- sprintf(fmt, pat) 70 | saved <- options("download.file.method", "download.file.extra") 71 | options(download.file.method = "curl", download.file.extra = extra) 72 | on.exit(do.call(base::options, saved), add = TRUE) 73 | } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { 74 | fmt <- "--header=\"Authorization: token %s\"" 75 | extra <- sprintf(fmt, pat) 76 | saved <- options("download.file.method", "download.file.extra") 77 | options(download.file.method = "wget", download.file.extra = extra) 78 | on.exit(do.call(base::options, saved), add = TRUE) 79 | } 80 | 81 | # try to download renv 82 | message("* Downloading renv ", version, " ... ", appendLF = FALSE) 83 | prefix <- "https://api.github.com" 84 | url <- file.path(prefix, "repos/rstudio/renv/tarball", version) 85 | destfile <- tempfile("renv-", fileext = ".tar.gz") 86 | on.exit(unlink(destfile), add = TRUE) 87 | utils::download.file(url, destfile = destfile, mode = "wb", quiet = TRUE) 88 | message("Done!") 89 | 90 | # attempt to install it into bootstrap library 91 | message("* Installing renv ", version, " ... ", appendLF = FALSE) 92 | dir.create(path, showWarnings = FALSE, recursive = TRUE) 93 | utils::install.packages(destfile, repos = NULL, type = "source", lib = path, quiet = TRUE) 94 | message("Done!") 95 | 96 | }) 97 | 98 | # try again to load 99 | if (requireNamespace("renv", lib.loc = path, quietly = TRUE)) { 100 | message("Successfully installed and loaded renv ", version, ".") 101 | return(renv::load()) 102 | } 103 | 104 | # failed to download or load renv; warn the user 105 | msg <- c( 106 | "Failed to find an renv installation: the project will not be loaded.", 107 | "Use `renv::activate()` to re-initialize the project." 108 | ) 109 | 110 | warning(paste(msg, collapse = "\n"), call. = FALSE) 111 | 112 | }) 113 | -------------------------------------------------------------------------------- /trendy.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | --------------------------------------------------------------------------------