Skip to content

False positive implicit NA warning with factors and 0-row slices #4460

@DavisVaughan

Description

@DavisVaughan

These shouldn't be showing up right? It also occurs with vec_slice(ig, 0). We will need to create these 0 row slices for ptypes.

library(dplyr, warn.conflicts = FALSE)
ig <- group_by(iris, Species)
ig[0,]
#> Warning: Factor `Species` contains implicit NA, consider using
#> `forcats::fct_explicit_na`

#> Warning: Factor `Species` contains implicit NA, consider using
#> `forcats::fct_explicit_na`
#> # A tibble: 0 x 5
#> # Groups:   Species [1]
#> # … with 5 variables: Sepal.Length <dbl>, Sepal.Width <dbl>,
#> #   Petal.Length <dbl>, Petal.Width <dbl>, Species <fct>

Created on 2019-07-02 by the reprex package (v0.2.0.9000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions