markfairbanks / tidypolars

Tidy interface to polars
http://tidypolars.readthedocs.io
MIT License
321 stars 10 forks source link

Implement `replace_null()` #128

Closed markfairbanks closed 2 years ago

markfairbanks commented 2 years ago
library(tidyverse)

df <- tibble(x = c(1, NA))

df %>%
  mutate(x = replace_na(x, 2))
#> # A tibble: 2 × 1
#>       x
#>   <dbl>
#> 1     1
#> 2     2

df %>%
  replace_na(list(x = 2))
#> # A tibble: 2 × 1
#>       x
#>   <dbl>
#> 1     1
#> 2     2