Replace NA values of a variable in a dataframe
Examples
data <- data.frame(nr = c(1,2,3,NA,NA))
replace_na_with(data, "nr", 0)
#> replace NA in variable nr with 0
#> nr
#> 1 1
#> 2 2
#> 3 3
#> 4 0
#> 5 0
Replace NA values of a variable in a dataframe
data <- data.frame(nr = c(1,2,3,NA,NA))
replace_na_with(data, "nr", 0)
#> replace NA in variable nr with 0
#> nr
#> 1 1
#> 2 2
#> 3 3
#> 4 0
#> 5 0