R: Replacing NAs in all factors with ‘Missing’

This post was originally published here

With a simple combination of mutate_if and fct_explicit_na,you can replace all NAs in all factors with “Missing”:

dplyr reference: http://dplyr.tidyverse.org/reference

forcats reference: http://dplyr.tidyverse.org/reference

Leave a Reply

Your email address will not be published. Required fields are marked *