R/ts_gtrends_windows.R
ts_gtrends_windows.Rd
Downloads approximate daily series over a sequence of time-windows by first
constructing the appropriate time windows and then downloading daily data
for each time-window using ts_gtrends()
.
ts_gtrends_windows(
keyword = NA,
category = "0",
geo = "CH",
from = "2019-01-01",
prevent_window_shrinkage = FALSE,
stepsize = 7,
windowsize = 80,
n_windows = 12,
quiet = FALSE,
wait = 60,
retry = 5
)
A character vector with the actual Google Trends query
keywords. Defaults to NA which searches for the whole category. Contrary
to gtrendsR::gtrends()
, if different keywords are used,
mulitple queries are sent to Google, and each series is individually
normalized.
A character vector, listing the categories, defaults to
"0"
. Passed to gtrendsR::gtrends()
A character vector denoting geographic regions for the query,
default is "CH"
. Passed to gtrendsR::gtrends()
Start of timeframe in YYYY-mm-dd form.
If TRUE
, ensures that the last time-window
is large enough to yield the desired frequency. Default is FALSE
.
Number of days (integer) between the start days of the respective time-windows.
Number of days (integer) from start date to end date of each window.
Number (integer) of time-windows.
If TRUE won't display messages related to server interactions. Default is FALSE.
Seconds to wait between attempts, where waiting time is attempt * wait
.
Number of attempts, in case the query request does not succeed.
A tibble of time series with columns window, time, value, where window is the time window indicated by start and end date of the window.
Time-windows may overlap - and will do so if stepsize
< windowsize
.