PMassicotte / gtrendsR

R functions to perform and display Google Trends queries
352 stars 112 forks source link

How to automate collections in Google Trends for different states using R? #430

Closed ghost closed 1 year ago

ghost commented 1 year ago

I want to compare interest over time in ten terms, so I decided to use the gtrendsR package. As Google Trends allows a maximum of five terms per query, I decided to perform three queries, in all of them including the term with the highest peak value (the top keyword) to ensure that the data are equally normalized. However, as I also intend to investigate interest over time for each Brazilian state (and each state can have a different top keyword), I wonder if there would be a way to automate the queries with a loop in which is possible:

  1. To identify the top keyword for each Brazilian state;

  2. Perform the collections including the top keyword in the different queries for each state in particular.

PMassicotte commented 1 year ago

I am not sure to understand your question. Why could you not use a loop?

ghost commented 1 year ago

I am not sure to understand your question. Why could you not use a loop?

Yes, that's my question. Is there a way to develop a loop in R to get this information?

PMassicotte commented 1 year ago

https://github.com/PMassicotte/gtrendsR/issues/271