step_group_lag: Create Lag values by group

View source: R/group_lag.R

step_group_lagR Documentation

Create Lag values by group

Description

step_group_lag creates a specification of a recipe step that will creates 1:4 & 10 lag values by group of user specified

Usage

step_group_lag(
  recipe,
  ...,
  role = "predictor",
  trained = FALSE,
  lag_table = NULL,
  skip = FALSE,
  id = recipes::rand_id("group_lag")
)

Arguments

recipe

A recipe object. The step will be added to the sequence of operations for this recipe.

...

One or more selector functions to choose variables for this step. See selections() for more details.

role

Not used by this step since no new variables are created.

trained

A logical to indicate if the quantities for preprocessing have been estimated.

lag_table

Group Lag table with lag values. This is NULL until computed by prep().

skip

A logical. Should the step be skipped when the recipe is baked by bake()? While all operations are baked when prep() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations.

id

A character string that is unique to this step to identify it.


gouthaman87/FoodDemandApp documentation built on Jan. 3, 2023, 12:09 p.m.