Skip to content
Prev 138843 / 398506 Next

training svm

On Mar 7, 2008, at 2:17 AM, Oldrich Kruza wrote:

            
I am guessing that the data is already in R, so it should be easier  
to do it in R, especially if he doesn't know which columns are the  
ones with all identical values. For instance, suppose the data set is  
called x. Then the following would return TRUE for the columns that  
have all values the same:

allsame <- sapply(x,function(y) length(table(y))==1)

and then the following will take them out

newdata <- x[,!allsame]
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College