simple_daily_series: Generate a daily time series from a broader time frame.

View source: R/simple_daily_series.R

simple_daily_seriesR Documentation

Generate a daily time series from a broader time frame.

Description

[Experimental]

This is a more simplistic approach to generate daily data in a much broader time frame, where Google usually doesn't provide daily data at all. See more in section Method.

Usage

simple_daily_series(
  keyword = NA,
  category = NA,
  geo = "DE",
  from = "2006-01-01",
  verbose = TRUE
)

Arguments

keyword

A string with a single search query. At the moment, multiple search queries are not allowed.

category

A string with a single search category. Note: You can either input a keyword for this function or a single category but not both!

geo

A geographical region to restrict the search query to.

from

Start date of the search query.

verbose

Boolean value. True, if some status messages should be displayed in the console during runtime.

Value

A tibble with a date column and a value column of a daily time series.

Method

This function searches for multiple time periods with a duration of 9 months with sometimes significantly overlapping ranges of Google Trends data. The overlapping period is then used to ensure that the time series has a consistent scale. As of now, simple_daily_series and daily_series have a somewhat comparable trend to a certain degree. Important to note, simple_daily_series won't have a value in the time series that is above 100. But this function will also have outliers. If you search for a smoothed (and adjusted) time series, try the tempdisagg::td() function from the tempdisagg package.

Examples

simple_daily_series(
  keyword = "covid-19",
  geo = "DE",
  from = "2020-04-01",
  verbose = TRUE
)

johannes97s/ifwtrends documentation built on Oct. 9, 2022, 7:01 p.m.