make imputer work for factors (replace with mode)

should not fail.  the issue is that the second df is a factor that has never seen the level 'A' before, so a naive df$y[is.na(x)] <- 'A' would cause an error.