title: R - predict command error "undefined columns selected"
body: <p>I’m a newbie to R, and I’m having trouble with an R predict command.
  I receive this error</p>
  
  <pre><code> Error in `[.data.frame`(newdata, , as.character(object$formula[[2]])) : 
    undefined columns selected
  </code></pre>
  
  <p>when I execute this command:  </p>
  
  <pre><code>model.predict &lt;- predict.boosting(model,newdata=test)
  </code></pre>
  
  <p>Here is my model: </p>
  
  <pre><code>model &lt;- boosting(Y~x1+x2+x3+x4+x5+x6+x7, data=train)
  </code></pre>
  
  <p>And here is the structure of my test data:
      str(test)</p>
  
  <pre><code>'data.frame':   343 obs. of  7 variables:
   $ x1: Factor w/ 4 levels "Americas","Asia_Pac",..: 4 2 4 2 4 3 3 3 4 1 ...
   $ x2: Factor w/ 5 levels "Fifth","First",..: 3 3 2 2 4 2 4 4 1 1 ...
   $ x3: Factor w/ 3 levels "Best","Better",..: 2 3 1 1 3 2 2 1 3 3 ...
   $ x4: Factor w/ 2 levels "Female","Male": 1 1 2 1 1 2 1 2 2 2 ...
   $ x5: int  82 55 47 31 6 53 77 68 76 86 ...
   $ x6: num  22.8 14.6 25.5 38.3 7.9 32.8 4.6 34.2 36.7 21.7 ...
   $ x7: num  0.679 0.925 0.897 0.684 0.195 ...
  </code></pre>
  
  <p>And the structure of my training data:</p>
  
  <pre><code>$ RecordID: int  1 2 3 4 5 6 7 8 9 10 ...
   $ x1      : Factor w/ 4 levels "Americas","Asia_Pac",..: 1 2 2 3 1 1 1 2 2 4 ...
   $ x2      : Factor w/ 5 levels "Fifth","First",..: 5 5 3 2 5 5 5 4 3 2 ...
   $ x3      : Factor w/ 3 levels "Best","Better",..: 2 3 2 2 3 1 2 3 1 1 ...
   $ x4      : Factor w/ 2 levels "Female","Male": 1 2 2 2 1 1 2 2 1 1 ...
   $ x5      : int  1 67 75 51 84 33 21 80 48 5 ...
   $ x6      : num  21 13.8 30.3 11.9 1.7 13.2 33.9 17 3.4 19.5 ...
   $ x7      : num  0.35 0.85 0.73 0.39 0.47 0.13 0.2 0.12 0.64 0.11 ...
   $ Y       : Factor w/ 2 levels "Green","Yellow": 2 2 1 2 2 2 1 2 2 2 ..
  </code></pre>
  
  <p>I think there’s a problem with the structure of the test data, but I can’t find it, or I have a mis-understanding as to the structure of the “predict” command.  Note that if I run the predict command on the training data, it works.  Any suggestions as to where to look?</p>
  
  <p>Thanks!</p>