Skip to content

step_normalize() errors if only applied to one variable #963

Description

@EmilHvitfeldt
library(recipes)

recipe(~., data = mtcars) %>%
  step_normalize(disp) %>%
  prep()
#> Error in array(STATS, dims[perm]): 'dims' cannot be of length 0

recipe(~., data = mtcars) %>%
  step_normalize(disp, vs) %>%
  prep()
#> Recipe
#> 
#> Inputs:
#> 
#>       role #variables
#>  predictor         11
#> 
#> Training data contained 32 data points and no missing data.
#> 
#> Operations:
#> 
#> Centering and scaling for disp, vs [trained]

Created on 2022-04-22 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions