<!-- If this issue relates to usage of the package, whether a question, bug or similar, along with your query, please paste your devtools::session_info() or sessionInfo() into the code block below. If not, delete all this and proceed :) --> The creation of the `replace_with_na` functions has been nice - and the scoped variants (`_at`, `_if`, and `_all`) have been useful. I think it would be useful to have functions that go the other way - from NA to a value. This could be called `replace_na_with` - to provide a more direct complement to `replace_with_na`. This is of interest to users, see [this SO question](https://stackoverflow.com/questions/8161836/how-do-i-replace-na-values-with-zeros-in-an-r-dataframe?rq=1) This could be written something like this: ```r replace_na_with <- function(vars, value) mutate_at(vars, funs(replace(., is.na(.), value))) ```
Activity
HughParsonage commentedon Jan 28, 2018
Extant functions include
dplyr::coalesceandhutils::coalesce(by me).njtierney commentedon Apr 23, 2023
We should re-export
coalesceand provide documentation on how to use it, alongside thereplace_with_nafunctionprovide replace_na_with, a complement to replace_with_na. Resolves #129