Replaces NA values in all numeric columns using specified filling method.
fill_na(df, mode = "value", value = 0)
Data frame with NA values filled
df <- data.frame(a = c(1, NA, 3), b = c(NA, 2, NA))
fill_na(df) # fills with 0
#> a b
#> 1 1 0
#> 2 0 2
#> 3 3 0
fill_na(df, mode = "mean")
#> a b
#> 1 1 2
#> 2 2 2
#> 3 3 2
fill_na(df, mode = "locf")
#> a b
#> 1 1 NA
#> 2 1 2
#> 3 3 2