get_seasonality: get_seasonality
Description
generate seasonality variables
Usage
get_seasonality(
data,
date_col_name,
date_type = "weekly starting",
verbose = FALSE,
keep_dup = FALSE,
pool_var = NULL
)
Value
data.frame
with added variables
Arguments
- data
data.frame
containing data for analysis
- date_col_name
The date column name as a string
- date_type
The date column type as either of the following strings:'weekly starting','weekly ending','daily'
- verbose
A boolean to specify whether to print warnings
- keep_dup
A boolean to specify whether to keep duplicate columns between seasonal and data
- pool_var
The pool (group) column name as a string (e.g. 'country')
Details
generate seasonality variables from a data.frame
containing a date-type variable.
Examples
Run this coderead_xcsv("https://raw.githubusercontent.com/paladinic/data/main/ecomm_data.csv") %>%
get_seasonality(date_col_name = 'date')
Run the code above in your browser using DataLab