title: Error in eval(predvars, data, env) : object 'Example' not found in RandomForest function
body: <p>Im just playing with a Random Forest, but I seem to have an issue. When I try use the <code>randomForest()</code> function, it returns the error : <code>Error in eval(predvars, data, env) : object '180018R' not found</code>. Here are the latest (relevant) lines of code, followed by the <code>structure()</code> output. </p>
  
  <pre><code>install.packages("randomForest")
  
  # Random forest
  
  data &lt;- as.data.frame(pattern_mat)
  str(data)
  
  # Response variable is "Response" Column 313
  data$Response &lt;- as.factor(data$Response)
  table(data$Response)
  
  ### Data Partition
  set.seed(123)
  ind &lt;- sample(2, nrow(data), replace=TRUE, prob=(c(0.7, 0.3)))
  train &lt;- data[ind==1,]
  test &lt;- data[ind==2,]
  
  ### Random Forest
  library(randomForest)
  set.seed(222)
  rf &lt;- randomForest(Response~., data = train)
  </code></pre>
  
  <p><strong>Structure info</strong>
  *I have shortened the output as it is unnecessary. </p>
  
  <pre><code>&gt; str(train)
  'data.frame':   145 obs. of  313 variables:
   $ 180018R : num  1 0 0 0 0 0 0 0 0 0 ...
   $ 217220R : num  1 0 0 0 0 0 0 0 0 0 ...
   $ 217300R : num  1 0 0 0 0 0 0 0 0 0 ...
   $ 281722R : num  0 1 1 1 1 1 1 1 1 0 ...
   $ 681714R : num  0 1 1 1 1 1 1 1 1 0 ...
   $ 281730R : num  0 1 1 1 1 1 1 1 1 0 ...
   $ 681715R : num  0 1 1 1 1 1 1 1 1 0 ...
   $ 411113  : num  0 0 0 0 0 0 0 0 0 1 ...
   $ 478105  : num  0 0 0 0 0 0 0 0 0 1 ...
       :        :   : : : : : : : : : :
       :        :   : : : : : : : : : :
       :        :   : : : : : : : : : :
   $ 641112  : num  0 0 0 0 0 0 0 0 0 0 ...
   $ 641170  : num  0 0 0 0 0 0 0 0 0 0 ...
   $ 641370  : num  0 0 0 0 0 0 0 0 0 0 ...
   $ 641611  : num  0 0 0 0 0 0 0 0 0 0 ...
   $ 645342  : num  0 0 0 0 0 0 0 0 0 0 ...
    [list output truncated]
  </code></pre>
  
  <p>So as you can see the error: <code>Error in eval(predvars, data, env) : object '180018R' not found</code> mentioned <strong>180018R</strong> which is the name of the first column. </p>
  
  <p>Anyone knows what to do?</p>