Displaying 4 results from an estimated 4 matches for "parent_edu".
Did you mean:
parent_dev
2018 Apr 10
4
convert numeric variables to factor
...rical variable into factor.
> However, I get the following error message.
>
> > cols<- c(?GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL"
> "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", "MASSMEDIA_M",
> "HomeComputer", "HomeInternet") for (i in cols) {data.frame[,i]=
> as.factor(data.frame[,i])}
>
>
> Error: unexpected string constant in ?cols<- c(?GrMM", "RELG", "CASTE1",
>...
2018 Apr 10
0
convert numeric variables to factor
Thank you very much.
After that I have the following error:
cols<- c("GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL", "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", "MASSMEDIA_M", "HomeComputer", "HomeInternet")
> for (I in cols) {data.frame[,i]= as.factor(data.frame[,i])}
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called ?sort? on a list?
> On...
2018 Apr 10
0
convert numeric variables to factor
...converting the numerical variable into factor. However, I get the following error message.
> cols<- c(?GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL" "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", "MASSMEDIA_M", "HomeComputer", "HomeInternet") for (i in cols) {data.frame[,i]= as.factor(data.frame[,i])}
Error: unexpected string constant in ?cols<- c(?GrMM", "RELG", "CASTE1", "SECTOR", "S...
2018 Apr 09
2
convert numeric variables to factor
Hello,
Though Bert's and David's answers are what you should do, note that some
R functions that need factors will coerce their input variables when
necessary.
Have you tried to run the code you haven't posted without coercing to
factor? It might run...
Hope this helps,
Rui Barradas
On 4/9/2018 6:11 PM, David L Carlson wrote:
> Try the help files:
>
> ?factor
>