Hi there,
I got two datasets which I joined 1:1. Since not every observation in the left has a observation on the right I have NA in the new on. Now I want to change the NA to "no". Problem is, that I am ahead of my team and don´t know how many variables I will join, but I wan´t to close this task now. Also the variables are factors. I tried this:
dt.full <- left_join(dt.left,dt.right) %>%
mutate_at(vars(starts_with("var_")), ~ if_else(is.na(.), "no", .))
and this
dt.full <- left_join(dt.left,dt.right) %>%
mutate_at(vars(starts_with("var_")), ~ ifelse(is.na(.), "no", .))
but both doesn´t solve the factor problem.
Can anybody help?
Thanks