I am gathering Google Trends data using the R package gtrendsR. I am pulling data on searches for "politics" in every U.S. state between two dates. Here is the code.
politics1 <- gtrends(query = "politics", geo = c("AL", "AK", "AZ", "AR", "CA"), start_date = "2015-08-01", end_date = "2015-10-01")
The problem is that gtrendsR does not allow for more than 5 locations (states) in "geo" at once. But, of course, I need to do the above for all 50 states. How can I create loop (or something similar) so that I can easily run this code on all states, in segments of 5 at a time, and then combine all of these separate objects (politics1, politics2, politics3, etc.) into one dataframe? Any thoughts are appreciated, thanks!