tk_augment_fourier: Add many fourier series to the data

Description Usage Arguments Details Value See Also Examples

View source: R/augment-tk_augment_fourier.R

Description

A handy function for adding multiple fourier series to a data frame. Works with dplyr groups too.

Usage

1
tk_augment_fourier(.data, .date_var, .periods, .K = 1, .names = "auto")

Arguments

.data

A tibble.

.date_var

A date or date-time column used to calculate a fourier series

.periods

One or more periods for the fourier series

.K

The maximum number of fourier orders.

.names

A vector of names for the new columns. Must be of same length as the number of output columns. Use "auto" to automatically rename the columns.

Details

Benefits

This is a scalable function that is:

Value

Returns a tibble object describing the timeseries.

See Also

Augment Operations:

Underlying Function:

Examples

1
2
3
4
5
6
library(tidyverse)
library(timetk)

m4_monthly %>%
    group_by(id) %>%
    tk_augment_fourier(date, .periods = c(6, 12), .K = 2)

timetk documentation built on Jan. 19, 2022, 5:07 p.m.