Skip to content

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

Closed
@DavisVaughan

Description

@DavisVaughan
Member

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)

Activity

added
bugan unexpected problem or unintended behavior
on Jul 16, 2019
added this to the 0.8.4 milestone on Jul 16, 2019
added a commit that references this issue on Jul 17, 2019
79b3505
added a commit that references this issue on Jul 17, 2019
b82aff2
lock

lock commented on Jan 13, 2020

@lock

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

locked and limited conversation to collaborators on Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @romainfrancois@DavisVaughan

      Issue actions

        False positive implicit NA warning with factors and 0-row slices · Issue #4460 · tidyverse/dplyr