Skip to contents

rpwf reserves "pd.index" as a special role for pandas index. This function is a wrapper for recipes::update_role() where the new role is a "pd.index"

Usage

update_role_pd_index(obj, index_col)

Arguments

obj

recipe object

index_col

index column

Value

recipe object with a variable that has the "pd.index" role.

Examples

r <- recipes::recipe(mpg ~ ., data = mtcars) |>
  update_role_pd_index(cyl)
r
#> Recipe
#> 
#> Inputs:
#> 
#>       role #variables
#>    outcome          1
#>   pd.index          1
#>  predictor          9