PMassicotte/gtrendsR

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

Closed this issue · 3 comments

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.

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

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?