survey is a data.frame so what do you expect factor(survey) to do?
If you want to convert everything to factors then you may do:
survey <- data.frame(lapply(survey,as.factor))
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more