Error in 1:nrow(newdata) : argument of length 0 while using SVM predict
<p>I'm trying to predict A values based upon model trained by svm. 
This is how my train and test data looks like: </p>

<pre><code>A     B    C     D
r00  r01  r02   r03
...  ...  ...   ...
</code></pre>

<p>Code Snippet is given below:</p>

<blockquote>
  <p>featvecs = ["B"]</p>
</blockquote>

<pre><code>for (f in 1:nrow(featvecs)) {
    tuned &lt;- svm(A ~., data = train[,c("A",featvecs[f,])], gamma = 0.01, cost = 10, kernel= "radial")
    svm.predict &lt;- predict(tuned, test[,featvecs[f,]])
}
</code></pre>

<p>I'm getting the following error for the svm.predict line and am not really sure why?</p>

<pre><code>Error in 1:nrow(newdata) : argument of length 0
</code></pre>

<p>Structure for train data:</p>

<pre><code>structure(list(A = structure(6L, .Label = c("'1'", 
"'2'", "'3'" ), class = "factor"), B =  structure(15L, .Label = c(...)...)
</code></pre>

<p>Structure for test data: </p>

<pre><code>structure(list(A = structure(2L, .Label = c("'1'", 
"'2'", "'3'" ), class = "factor"), B =  structure(17L, .Label = c(...)...)
</code></pre>