[R] SVM error.

Jim Lemon drjimlemon at gmail.com
Wed Jun 3 08:34:06 CEST 2015


Hi Pijush,
Without access to the data, we can only guess. However, in such cases
the problem is often a factor variable where you expect a numeric one.
Try this:

is.factor(x)

and if the answer is TRUE, you have found your problem.

Jim


On Wed, Jun 3, 2015 at 4:13 PM, Pijush Das <topijush at gmail.com> wrote:
> Dear Sir,
>
> I am facing an error when I am trying to use svm and found similar kind of
> problem faced by other. But I unable to solve the problem. The problem is
> given below.
>
>> rm(list=ls(all=TRUE))
>> CombinedGeneList <- read.xlsx(file.choose(), sheet = 1, colNames =
> TRUE,rowNames = TRUE)
>> NoemalisedData <- read.xlsx(file.choose(), sheet=1,colNames =
> TRUE,rowNames = TRUE)
>> status<-NoemalisedData[1, ]
>> FilterData <-NoemalisedData[rownames(CombinedGeneList), ]
>> TFilterData <- t(FilterData)
>> Tstatus <- t(status)
>> x<-TFilterData
>> y<-Tstatus
>> model <- svm( x, y)
> Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
>>
>
>
>
> Please solve the problem. I have tried it in many ways.
> Waiting for your reply.
> Thank you
>
>
>
> With regards
> Pijush
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list