title: Error in predict.svm:constant. Cannot scale data
body: <p>I get my dataset from the below function:</p>
  
  <pre><code>dataGenerator&lt;-function(size){
          x &lt;- runif( size,1,10)
          y &lt;- runif( size,1,10)
          data.frame(X=x,Y=y)
  }
  </code></pre>
  
  <p>And then i try to add two columns to it using this code</p>
  
  <pre><code>smiller&lt;-function(points){
  
    for(i in i:nrow(points)){
      if(6&lt;points[i,1] &amp; points[i,1]&lt;7 &amp; 6&lt;points[i,2] &amp; points[i,2]&lt;7)
        points["scores"] &lt;- as.vector((points[i,1]-7)^2+(points[i,2]-7)^2)
      else
        points["scores"] &lt;- as.vector((points[i,1]-5)^2+(points[i,2]-5)^2-9)
    }
    points["class"]&lt;-(as.vector(  points$scores&lt;0 ))
    points
  }
  </code></pre>
  
  <p>here is the call</p>
  
  <pre><code>train &lt;-smiller(  dataGenerator(100))
  </code></pre>
  
  <p>and at the end i try to leran it using  a svm classifier on it.</p>
  
  <pre><code>   model &lt;- svm(class ~ . , train,type = "C",kernel = "linear")
  </code></pre>
  
  <p>but it complains with:</p>
  
  <pre><code>Variable(s) �scores� constant. Cannot scale data.
   Show Traceback
  Error in predict.svm(ret, xhold, decision.values = TRUE) : Model is empty!
  </code></pre>