title: using ksvm of kernlab package for predicting has an error
body: <p>I use ksvm function to train the data, but in predicting I have an error,here is the code:</p>
  
  <pre><code> svmmodel4 &lt;- ksvm(svm_train[,1]~., data=svm_train,kernel = "rbfdot",C=2.4,
                 kpar=list(sigma=.12),cross=5)
  </code></pre>
  
  <p><b>Warning message:
  In .local(x, ...) : Variable(s) `' constant. Cannot scale data.</b></p>
  
  <pre><code>pred &lt;- predict(svmmodel4, svm_test[,-1])
  </code></pre>
  
  <p><b>Error in eval(expr, envir, enclos) : object 'res_var' not found.</b></p>
  
  <p>If I add the response variable, it works:</p>
  
  <pre><code>pred &lt;- predict(svmmodel4, svm_test)
  </code></pre>
  
  <p>But if you add the response variable,how can it be "predict"? what is wrong with my code? Thanks for your help!</p>
  
  <p>The complete code:</p>
  
  <pre><code>library(kernlab)
  svmData &lt;- read.csv("svmData.csv",header=T,stringsAsFactors = F)
  svmData$res_var &lt;- as.factor(svmData$res_var)
  svm_train &lt;- svmData1[1:2110,]
  svm_test &lt;- svmData1[2111:2814,]
  svmmodel4 &lt;- ksvm(svm_train[,1]~.,data = svm_train,kernel = "rbfdot",C=2.4, 
                kpar=list(sigma=.12),cross=5)
  pred1 &lt;- predict(svmmodel4,svm_test[,-1])
  </code></pre>