pca: Principal component analysis on Google Trends time series

View source: R/pca.R

pcaR Documentation

Principal component analysis on Google Trends time series

Description

pca computes for several search queries or several categories the principal components of the monthly time series.

Usage

pca(
  keywords = NA,
  categories = 0,
  geo = "DE",
  time = str_c("2006-01-01 ", Sys.Date())
)

Arguments

keywords

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

categories

A vector (num) with Google Trends category numbers.

geo

A geographical region to restrict the search queries to.

time

A string consisting of a start date and an end date (separated with a space). Check the example for an example.

Value

Tibble with monthly principal components next to the actual time series.

Examples

pca(keywords = c("ikea", "saturn"), time = "2018-01-01 2020-01-01")


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