Skip to content

fct_other() gives confusing "Unknown levels" warning #265

Closed
@xelax

Description

@xelax

when no values in f triggers the generation of "Other" then a warning message is emitted. This is particularly troublesome on very large grouped datasets because you get a warning for each group and it takes forever to process it.

library(forcats)
fct_other(c("A"), keep="A")
#> Warning: Unknown levels in `f`: Other
#> [1] A
#> Levels: A
fct_other(c("A", "B"), keep="A")
#> [1] A     Other
#> Levels: A Other

Created on 2020-07-02 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorhelp wanted ❤️we'd love your help!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions