Re: [R] convert numeric variables to factor

2018-04-10 Thread Saif Tauheed
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

Re: [R] convert numeric variables to factor

2018-04-10 Thread Saif Tauheed
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/20

Re: [R] convert numeric variables to factor

2018-04-09 Thread Saif Tauheed
Dear Sir, I have xlsx data set which I have imported to R studio. Now some of the variables are defined as numeric but I want define them as factor variable so that I run classification algorithm in R. Please to covert the variables. Thanks and Regards Abu Afzal PhD Eco JNU India