Replacing NA's in a dataframe/tibble

Thanks for the suggestion to look again at replace_na. After some more experimentation these worked well and are slightly simpler:

mutate_all(funs(replace_na(., 0)))
mutate_if(is.numeric, funs(replace_na(., 0)))

3 Likes