Google Trends sub regions over time

I'm looking at google trend results over time in the U.S. However, I don't just want data over time for the United States. I want it over time for every state and county. Now, when you run this code, you only get over time for the U.S and then average values for states and counties.

Anyone know a way around this that doesn't involve typing out every state and county code into the geo = section?

data_frame <- gtrends("hotdogs",
geo = "US",
gprop = "web",
time = "2020-2-01 2020-04-07")

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.

This may be a particularly hard one to reproduce, however, without guessing that the gtrends is in the gtrends$ package. (Lucky guess on my part.)

The only way to answer without a reprex (and getting one's own API key if needed) is to look at the help(gtrends) page.

The answer is right in the Arguments section

geo	    character vector denoting geographic regions for the query, default to “all” for global queries. Multiple regions are possible using gtrends("NHL", c("CA", "US")).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.