Skip to content

n argument for step_other #289

@brshallo

Description

@brshallo

Would like if threshold argument within step_other() could be specified by an integer (rather than just by proportion), or had a separate n argument to specify the minimum sample size before it is collapsed into the "other" category.
E.g. to specify minimum sample size of 30:

recipe(price ~ clarity + color + carat, data = diamonds) %>% 
  step_other(all_nominal(), n = 30)

I'm curious what the best way of doing this is currently? (Link to hack for specifying consistent sample size to step_other across datasets of different sizes.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    tidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-day

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions