I had a dataframe where I recoded several columns so that 999 was set to NA
dfB <-dfA %>% mutate(adhere = if_else(adhere==999, as.numeric(NA), adhere
If you are trying to recode something to an NA the na_if() function should also work.