Displaying 1 result from an estimated 1 matches for "scs2".
Did you mean:
sc22
2013 Feb 21
3
Having trouble converting a dataframe of character vectors to factors
R Experts,
I have a dataframe made up of character vectors--these are results from survey questions. I need to convert them to factors.
I tried the following which did not work:
scs2<-sapply(scs2,as.factor)
also this didn't work:
scs2<-sapply(scs2,function(x) as.factor(x))
After doing either of above I end up with
>str(scs2)
chr [1:10, 1:10] "very important" "very important" "very important" "very important" ...
- attr(*,...