Dear Sir,

I have converted the data into numeric as the function read.excel read the
data file as a character (as it was said by David Meyer, maintainer of the
package e1071) and after that run the function svm. Then another error is
found there. The detail description of the code and error is given below.

Please check this code and try to solve the error.


> library(e1071)
> library("openxlsx")
>List <- read.xlsx(file.choose(), sheet = 1,colNames = TRUE,rowNames = TRUE)
>Data <- read.xlsx(file.choose(), sheet=1,colNames = TRUE,rowNames = TRUE)
> status<-Data[1, ]
> View(status)
> FilterData <-Data[rownames(List), ]
> View(FilterData)
> TFData<-matrix( nrow=10, ncol=1630)
> for(i in 1:1630){
+   for(j in 1:10){
+     a<-FilterData[i,j]
+     TFData[j,i]<- as.numeric(a)
+
+   }
+ }
> Tstatus <- t(status)
> x<-TFData
> is.numeric(x)
[1] TRUE
> y<-Tstatus
> model <- svm( x, y)
Error in svm.default(x, y) :
  Need numeric dependent variable for regression.

Please find the attached files, given below.

Thank You



With regards
Pijush
______________________________________________
R-help@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.

Reply via email to