roll: Returns a tibble for backtesting with PCA.

View source: R/roll.R

rollR Documentation

Returns a tibble for backtesting with PCA.

Description

Returns for the time from start_period to end the respective result from pca() back.

Usage

roll(
  keyword = NA,
  category = 0,
  geo = "DE",
  start_series = "2006-01-01",
  start_period = "2014-01-01",
  end = Sys.Date(),
  fun = trendecon::ts_gtrends,
  ...
)

Arguments

keyword

A vector (chr) with search queries (or a single search query).

category

A vector (num) with Google Trends category numbers.

geo

A geographical region to restrict the search queries to.

start_series

Start date of the time series.

start_period

Start date of the returned time frame.

end

End date of time series and to be returned time frame.

fun

Name of a function, that will be applied to a time series.

...

Additional parameter for the function that is in fun specified.

Value

Tibble with monthly data where pca() is applied on every column. For each column, a new month is added.

Examples

roll(keyword = "ikea", start_series = "2018-01-01", start_period = "2019-01-01", end = "2020-01-01")

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