I have a very strange problem concerning the ifelse function: it does not return a factor (as I want) but something like the position of the factor.
The dataset I u
The field answer is factor, hence your function returns number (level of factor).
answer
What you need to do is:
aDDs$answer <- as.character(aDDs$answer)
and then it works.