r - How do I convert a logical variable to factor in Rattle -
i using rattle run randomforest against training data set. 1 of variables has values false , true.
> str(mydata) 'data.frame': 421570 obs. of 2 variables: $ trial : int 1 1 1 1 1 1 1 1 1 1 ... $ isholiday : logi false false false false false false ... i able convert same factor in r.
> mydata$isholiday <- factor(mydata$isholiday) > str(mydata) 'data.frame': 421570 obs. of 2 variables: $ trial : int 1 1 1 1 1 1 1 1 1 1 ... $ isholiday : factor w/ 2 levels "false","true": 1 1 1 1 1 1 1 1 1 1 ... when write data.frame csv , load using rattle, again seeing logical only. due this, getting error, error in na.roughfix.data.frame(x) + na.roughfix works numeric or factor
any appreciated. in advance
Comments
Post a Comment