Skip to content

complete() doesn't apply fill if there are no ... inputs #1272

@DavisVaughan

Description

@DavisVaughan
library(tidyr)

df <- tibble(a = c(1, 2, 3), c = c(1, NA, 3))
df
#> # A tibble: 3 × 2
#>       a     c
#>   <dbl> <dbl>
#> 1     1     1
#> 2     2    NA
#> 3     3     3

# should apply fill here anyways
complete(df, fill = list(c = 0))
#> # A tibble: 3 × 2
#>       a     c
#>   <dbl> <dbl>
#> 1     1     1
#> 2     2    NA
#> 3     3     3

complete(df, a, fill = list(c = 0))
#> # A tibble: 3 × 2
#>       a     c
#>   <dbl> <dbl>
#> 1     1     1
#> 2     2     0
#> 3     3     3

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions