Creates or updates an index using data from already downloaded keywords.

proc_index(keywords, geo, index_name)

Arguments

keywords

A vector of keyword names comprising the index.

geo

A character vector denoting geographic region.

index_name

The name given to the index.

Details

This function assumes the data for all keywords exists. Then it proceeds to go through several steps:

  1. updates all the keywords by downloading newest Google trends data.

  2. combines monthly, weekly, and daily frequencies.

  3. runs seasonal adjustment steps.

  4. combines all the keywords into one index using principal components.

  5. writes the produced index to a file

Examples

if (FALSE) { # \dontrun{
keywords <- c("Mango", "Zara", "H&M", "PKZ", "Blue Tomato", "Dosenbach", "Schuhe kaufen", "Ochsner Schuhe")
proc_index(keywords, "ch", "clothing")
} # }