add_id_column: Helper function to add ID column

View source: R/gtpreparation.R

add_id_columnR Documentation

Helper function to add ID column

Description

This function checks if the dataframe from Google contains a column "id". If there is no said column, this function adds one with the fitting ID from Google.

Usage

add_id_column(data, keyword, category)

Arguments

data

A tibble or dataframe containing a Google Trends time series.

keyword

The keyword or keywords that have been searched in the prior function.

category

The category ID from Google Trends.

Value

A tibble with an added ID column, if there was no beforehand. Otherwise, the original data will be returned.


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