Open marcyshieh opened 2 years ago
It is a problem how you loop over the dates. You can only download daily data for at moist 270 days.
The code you get builds queries for each month.
pm <- tibble(s = seq(ymd(from), ymd(to), by = 'month'),
e = seq(ymd(from), ymd(to), by = 'month') + months(1) - days(1))
Also note that what you are doing makes the resulting time series hardly useful, since the queries are not comparable over time. You are stitching daily hits together which are standardized for the time frame in which you download the data.
See our paper: https://www.sciencedirect.com/science/article/abs/pii/S2452306221001210
This has nothing to do with the package, it is just how your code is written.
This is also what Google Trends returns:
https://trends.google.com/trends/explore?date=2019-12-31%202020-11-01&geo=US&q=charles%20jones
Using the gtrendsR package and a modified version of Alex Dyachenko’s tutorial, I’ve been trying to query estimated Google Trends daily hits. I noticed that my modified version of Alex’s code doesn’t allow me to stop mid-month. In my modified version, all the days past the last day of the previous month show up as NA. Is there a way to resolve the issue?
In essence, I am just trying to replicate the steps in this Medium article but instead of doing monthly, I want to do an entire range of time.
Here's some replication code and the sample.xlsx file.