Skip to content

Let complete() behave better when nesting NULL #1258

@psychelzh

Description

@psychelzh

When passing NULL to nesting() in calling complete(), it behaves differently than when not passing nesting() to complete(). From user's aspect, it is more intuitive if they should behave similarly.

library(tidyr)
df <- data.frame(x = factor("A", LETTERS[1:2]))
complete(df, x)
#> # A tibble: 2 x 1
#>   x    
#>   <fct>
#> 1 A    
#> 2 B
complete(df, x, nesting(NULL))
#> # A tibble: 1 x 1
#>   x    
#>   <fct>
#> 1 A

Created on 2021-12-09 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions